Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c194c1141 | |||
| b41136e2c7 |
@@ -76,6 +76,14 @@ public static class Api
|
|||||||
|
|
||||||
public static WebApplication AddSecurityEndpoints(this WebApplication app)
|
public static WebApplication AddSecurityEndpoints(this WebApplication app)
|
||||||
{
|
{
|
||||||
|
app.MapGet("/login", async (HttpContext context, string redirectUri = "/") =>
|
||||||
|
{
|
||||||
|
await context.ChallengeAsync(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties
|
||||||
|
{
|
||||||
|
RedirectUri = redirectUri,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
app.MapGet("/logout", async (HttpContext context, IHttpClientFactory httpClientFactory, IOptions<LiteCharmsSettings> settings) =>
|
app.MapGet("/logout", async (HttpContext context, IHttpClientFactory httpClientFactory, IOptions<LiteCharmsSettings> settings) =>
|
||||||
{
|
{
|
||||||
await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||||
|
|||||||
Reference in New Issue
Block a user