Files
decePubClient/Pages/Logout.razor
T

24 lines
807 B
Plaintext
Raw Normal View History

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
<section class="block relative w-full h-full neo-inset neo-xs rounded-xl">
2022-02-14 01:51:52 +01: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 {
[Inject] TokenAuthStateProvider AuthStateProvider { get; set; }
2022-02-14 01:51:52 +01: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()
{
await AuthStateProvider.LogoutAsync(true);
Navigation.NavigateTo("");
2022-02-14 01:51:52 +01:00
}
}