Logout: - It navigated to "authenticatio/logout", a misspelled route. - The correct template route, authentication/logout, would throw anyway. Its RemoteAuthenticatorView casts the AuthenticationStateProvider to the OIDC template's service, and the app registers TokenAuthStateProvider instead. - It now signs out through TokenAuthStateProvider.LogoutAsync, as the code commented out in the page intended, and returns home. LoginDisplay's sign-out goes through it as well. - This also drops the obsolete SignOutSessionStateManager, the build's last warning. The IndexedDB schema never declared the ClientLogs store that IStorage.AddLog writes to, so every client log write failed inside its try/catch. Version 2 adds the store, keyed by the Id AddLog assigns. DInputBase.NameAttribute renders no name instead of name="" when the form maps no field names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
27 lines
926 B
Plaintext
27 lines
926 B
Plaintext
@page "/logout"
|
|
@inherits LocalizableComponentBase
|
|
<Title>@Localizer["Logout"]</Title>
|
|
|
|
<section class="block relative w-full h-full neo-inset neo-xs rounded-xl">
|
|
|
|
<div class="flex flex-col gap-4 p-4 md:p-5 w-full h-full absolute overflow-y-auto">
|
|
<h1 class="text-center">@Localizer["Logging out..."]</h1>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
@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("");
|
|
}
|
|
}
|