bulletboards/ImageBoardServerApp/Pages/Accounts/Logout.razor
2023-06-08 23:34:59 +02:00

20 lines
No EOL
636 B
Text

@page "/sys/logout"
@using ImageBoardServerApp.Auth
@inject NavigationManager navManager
@inject AuthenticationStateProvider authStateProvider
<h3>Logging out...</h3>
@code {
protected override async Task OnParametersSetAsync()
{
await base.OnParametersSetAsync();
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
var customAuthStateProvider = (CustomAuthenticationStateProvider) authStateProvider;
await customAuthStateProvider.UpdateAuthenticationStateAsync(null);
navManager.NavigateTo("/", true);
}
}