Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ad410c64e | |||
| e193aa7c1c | |||
| 840d4568e2 |
@@ -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,15 +102,13 @@ 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);
|
await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||||
|
|
||||||
string currentBaseUrl = $"https://{context.Request.Host}{context.Request.PathBase}/";
|
|
||||||
|
|
||||||
await context.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties
|
await context.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties
|
||||||
{
|
{
|
||||||
RedirectUri = currentBaseUrl,
|
RedirectUri = "/",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user