Fixed the redirect URI on logout so its passed by the caller
continuous-integration/drone/pr Build is passing
continuous-integration/drone/pr Build is passing
This commit is contained in:
@@ -143,11 +143,17 @@ public static class Api
|
||||
});
|
||||
});
|
||||
|
||||
app.MapGet("/logout", async (HttpContext context) =>
|
||||
app.MapGet("/logout", async (HttpContext context, string? redirectUri = null) =>
|
||||
{
|
||||
var idToken = await context.GetTokenAsync("id_token");
|
||||
|
||||
var authProperties = new AuthenticationProperties { RedirectUri = "/", };
|
||||
if (string.IsNullOrWhiteSpace(redirectUri))
|
||||
{
|
||||
var host = context.Request.Host.ToUriComponent();
|
||||
redirectUri = $"https://{host}/";
|
||||
}
|
||||
|
||||
var authProperties = new AuthenticationProperties { RedirectUri = redirectUri, };
|
||||
|
||||
if (!string.IsNullOrEmpty(idToken))
|
||||
authProperties.Parameters.Add("id_token_hint", idToken);
|
||||
|
||||
Reference in New Issue
Block a user