34 lines
738 B
Plaintext
34 lines
738 B
Plaintext
@inject IAuthenticationClientService AuthenticationClientService
|
|
@inject NavigationManager NavigationManager
|
|
|
|
<MudPaper Class=@Class Style=@Style>
|
|
|
|
<AuthorizeView>
|
|
<Authorized>
|
|
<MudText>
|
|
Hello, @context.User.Identity.Name!
|
|
</MudText>
|
|
<MudButton OnClick="Logout"> LOGOUT </MudButton>
|
|
</Authorized>
|
|
<NotAuthorized>
|
|
<MudButton Class="" Href="Register"> Register </MudButton>
|
|
<MudButton Class="" Href="Login"> Login </MudButton>
|
|
</NotAuthorized>
|
|
</AuthorizeView>
|
|
|
|
</MudPaper>
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
public string? Class { get; set; }
|
|
|
|
[Parameter]
|
|
public string? Style { get; set; }
|
|
|
|
private async Task Logout()
|
|
{
|
|
await AuthenticationClientService.LogoutAsync();
|
|
NavigationManager.NavigateTo("/");
|
|
}
|
|
} |