@page "/logout" @inherits LocalizableComponentBase @Localizer["Logout"]

@Localizer["Logging out..."]

@code { [CascadingParameter] CascadingState CascadingState { get; set; } [Inject] TokenAuthStateProvider AuthStateProvider { get; set; } [Inject] NavigationManager Navigation { 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(""); } }