Adopted standard logout flow
continuous-integration/drone/pr Build is running

This commit is contained in:
Khwezi Mngoma
2026-06-07 13:56:49 +02:00
parent 840d4568e2
commit e193aa7c1c
+5 -6
View File
@@ -104,13 +104,12 @@ public static class Api
app.MapGet("/logout", async (HttpContext context) =>
{
var schemesToSignOut = new[] { CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme, };
await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
string postLogoutRedirectDestination = "/";
await context.SignOutAsync(scheme: null, properties: new AuthenticationProperties { RedirectUri = postLogoutRedirectDestination, });
foreach (var scheme in schemesToSignOut) await context.SignOutAsync(scheme);
await context.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties
{
RedirectUri = "/",
});
});
return app;