payments #91

Merged
khwezi merged 2 commits from payments into master 2026-06-07 13:57:16 +02:00
Showing only changes of commit 840d4568e2 - Show all commits
+7 -8
View File
@@ -27,7 +27,7 @@ public static class Api
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options => .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>
{ {
options.Authority = authOptions.Authority; options.Authority = authOptions.Authority;
options.ClientId = authOptions.ClientId; options.ClientId = authOptions.ClientId;
options.ClientSecret = authOptions.ClientSecret; options.ClientSecret = authOptions.ClientSecret;
@@ -102,16 +102,15 @@ public static class Api
}); });
}); });
app.MapGet("/logout", async (HttpContext context, IHttpClientFactory httpClientFactory, IOptions<LiteCharmsSettings> settings) => app.MapGet("/logout", async (HttpContext context) =>
{ {
await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); var schemesToSignOut = new[] { CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme, };
string currentBaseUrl = $"https://{context.Request.Host}{context.Request.PathBase}/"; string postLogoutRedirectDestination = "/";
await context.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties await context.SignOutAsync(scheme: null, properties: new AuthenticationProperties { RedirectUri = postLogoutRedirectDestination, });
{
RedirectUri = currentBaseUrl, foreach (var scheme in schemesToSignOut) await context.SignOutAsync(scheme);
});
}); });
return app; return app;