fixed chrome login

This commit is contained in:
Sarah Faey 2023-11-22 21:52:41 +01:00
parent df0170c20d
commit 2fbbe2f3a7
3 changed files with 13 additions and 3 deletions

View file

@ -669,6 +669,7 @@ namespace Lieb.Data
if(signup.SignUpType == SignUpType.Maybe && signup.LiebUserId.HasValue)
{
await SignOff(raid.RaidId, signup.LiebUserId.Value);
await _discordService.SendMessageToUsers("You have been signed off because you were still maybe.", raid.Title, new HashSet<ulong>(){signup.LiebUserId.Value});
}
}
}

View file

@ -33,7 +33,11 @@ builder.Services.AddAuthentication(opt =>
opt.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
opt.DefaultChallengeScheme = DiscordDefaults.AuthenticationScheme;
})
.AddCookie()
.AddCookie(options =>
{
options.Cookie.HttpOnly = true;
options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
})
.AddDiscord(x =>
{
x.AppId = builder.Configuration["Discord:AppId"];
@ -78,6 +82,11 @@ builder.Services.AddHttpClient(Constants.HttpClientName , httpClient =>
var app = builder.Build();
app.UseCookiePolicy(new CookiePolicyOptions()
{
MinimumSameSitePolicy = Microsoft.AspNetCore.Http.SameSiteMode.Lax
});
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
@ -100,7 +109,7 @@ using (var scope = app.Services.CreateScope())
DbInitializer.Initialize(context);
}
app.UseHttpsRedirection();
//app.UseHttpsRedirection();
app.UseStaticFiles();