decePubClient/Shared/LoginDisplay.razor
Eugenio Chiodo 5cba76554a Save
2022-02-14 01:51:52 +01:00

24 lines
687 B
Plaintext

@inject NavigationManager Navigation
@inject SignOutSessionStateManager SignOutManager
<AuthorizeView>
<Authorized>
<button class="button" @onclick="BeginSignOut">
@CascadingState.Localizer["Logout"]
</button>
</Authorized>
<NotAuthorized>
<NavLink ActiveClass="neoBtnSmallInsetPlain" class="button is-rounded neoBtnSmallPlain" href="authentication/login">
@CascadingState.Localizer["Login"]
</NavLink>
</NotAuthorized>
</AuthorizeView>
@code {
[CascadingParameter] CascadingState CascadingState { get; set; }
private async Task BeginSignOut(MouseEventArgs args)
{
await SignOutManager.SetSignOutState();
Navigation.NavigateTo("authentication/logout");
}
}