website/src/NSeguin.Dev.Web/Components/Shared/LoginDisplay.razor
2023-12-10 21:30:50 -06:00

20 lines
No EOL
460 B
Text

@inject NavigationManager Navigation
<AuthorizeView>
<Authorized>
Hello, @context.User.Identity?.Name!
<button class="nav-link btn btn-link" @onclick="BeginLogout">Log out</button>
</Authorized>
<NotAuthorized>
<a href="authentication/login">Log in</a>
</NotAuthorized>
</AuthorizeView>
@code{
private void BeginLogout(MouseEventArgs args)
{
Navigation.NavigateTo("authentication/logout");
}
}