Files
Shogi/Shogi.UI/Shared/LoginDisplay.razor

25 lines
872 B
Plaintext

@*@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication*@
@*@inject NavigationManager Navigation
@inject SignOutSessionStateManager SignOutManager*@
@*<AuthorizeView>
<Authorized>
Hello, @context.User.Identity?.Name!
<button class="nav-link btn btn-link" @onclick="BeginSignOut">Log out</button>
</Authorized>
<NotAuthorized>
<a href="authentication/login">Log in</a>
</NotAuthorized>
</AuthorizeView>*@
@code{
// https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/additional-scenarios?view=aspnetcore-6.0#customize-the-authentication-user-interface
//private async Task BeginSignOut(MouseEventArgs args)
//{
// await SignOutManager.SetSignOutState();
// Navigation.NavigateTo("authentication/logout");
//}
}