2022-02-14 01:51:52 +01:00
|
|
|
@page "/logout"
|
2022-12-15 20:03:40 +01:00
|
|
|
@inherits LocalizableComponentBase
|
|
|
|
|
<Title>@Localizer["Logout"]</Title>
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:08:11 +02:00
|
|
|
<section class="block relative w-full h-full neo-inset neo-xs rounded-xl">
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:08:11 +02:00
|
|
|
<div class="flex flex-col gap-4 p-4 md:p-5 w-full h-full absolute overflow-y-auto">
|
2022-12-15 20:03:40 +01:00
|
|
|
<h1 class="text-center">@Localizer["Logging out..."]</h1>
|
2022-02-14 01:51:52 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
@code {
|
2026-10-03 12:43:07 +02:00
|
|
|
[Inject] TokenAuthStateProvider AuthStateProvider { get; set; }
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:43:07 +02:00
|
|
|
// 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.
|
2022-02-14 01:51:52 +01:00
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
2026-10-03 12:43:07 +02:00
|
|
|
await AuthStateProvider.LogoutAsync(true);
|
|
|
|
|
Navigation.NavigateTo("");
|
2022-02-14 01:51:52 +01:00
|
|
|
}
|
|
|
|
|
}
|