-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logout Flow #13316
Comments
Yes please. Thise code doesn't work:
|
@VR-Architect Blazor Server app? If so, can you use the pattern used by a Blazor Server template app with Identity? Areas > Identity > Pages > Account > Logout.cshtml @page
@using Microsoft.AspNetCore.Identity
@attribute [IgnoreAntiforgeryToken]
@inject SignInManager<IdentityUser> SignInManager
@functions {
public async Task<IActionResult> OnPost()
{
if (SignInManager.IsSignedIn(User))
{
await SignInManager.SignOutAsync();
}
return Redirect("~/");
}
} <form method="post" action="Identity/Account/LogOut">
<button type="submit" class="nav-link btn btn-link">Log out</button>
</form> |
Note that this issue will be addressed with the scaffolding PR that I'm turning in shortly. btw -- The answer is along those lines ☝️, but you need an XSRF token to submit that form. I plan to have that approach on the PR. |
Please include the Logout Flow for Blazor Authorization using AuthenticationStateProvider
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: