@page "/logout"
@inherits LocalizableComponentBase
@Localizer["Logout"]
@Localizer["Logging out..."]
@code {
[Inject] TokenAuthStateProvider AuthStateProvider { get; set; }
// The app signs in with its own token (TokenAuthStateProvider), so signing out clears that token and the local
// database. The template's authentication/logout route can't do it: RemoteAuthenticatorView needs the OIDC
// provider this app replaces, and throws.
protected override async Task OnInitializedAsync()
{
await AuthStateProvider.LogoutAsync(true);
Navigation.NavigateTo("");
}
}