payments #91
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user