-
Notifications
You must be signed in to change notification settings - Fork 161
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 code not included. #450
Comments
+1 |
Solved by add the following to @page "/Account/Logout"
@using Microsoft.AspNetCore.Identity
@inject SignInManager<ApplicationUser> SignInManager
@inject NavigationManager NavigationManager
@code {
protected override async Task OnInitializedAsync()
{
await SignInManager.SignOutAsync();
NavigationManager.NavigateTo("/");
}
} And then you can logout a user from the app with the following: <MudNavLink Href="Account/Logout" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.ExitToApp">Logout</MudNavLink> It's very basic and there's room for improvement but for someone just trying to get it working quickly, it functions well enough |
`@implements IDisposable
@code {
} This uses the same convention as the official Blazor Template` |
The logout code from Microsoft admin pages are not included. Template 0.6.5
(Had hoped for a Mud admin )
The text was updated successfully, but these errors were encountered: