Web-Development-with-Blazor.../Chapter13/MyBlog/BlazorWebAssembly/Client/LoginStatusWasm.razor

19 lines
423 B
Text
Raw Normal View History

2023-02-17 15:28:17 +01:00
@implements ILoginStatus
@inject NavigationManager Navigation
<AuthorizeView>
<Authorized>
<a href="#" @onclick="BeginSignOut">Log out</a>
</Authorized>
<NotAuthorized>
<a href="authentication/login">Log in</a>
</NotAuthorized>
</AuthorizeView>
@code {
private async Task BeginSignOut(MouseEventArgs args)
{
Navigation.NavigateToLogout("authentication/logout");
}
}