Yuyuqt
add: authorization
0acba57
Raw
History Blame Contribute Delete
561 Bytes
@page "/logout"
@using BlazorFrontend.Providers
@using Microsoft.AspNetCore.Components.Authorization
@inject AuthenticationStateProvider AuthStateProvider
@inject NavigationManager Navigation
<PageTitle>Logging out...</PageTitle>
<div class="text-center mt-10">
<p class="text-slate-600">Signing you out...</p>
</div>
@code {
protected override async Task OnInitializedAsync()
{
var jwtProvider = (JwtAuthenticationStateProvider)AuthStateProvider;
await jwtProvider.LogoutAsync();
Navigation.NavigateTo("/login");
}
}