first commit -push
This commit is contained in:
25
RobotNet.WebApp/Pages/User.razor
Normal file
25
RobotNet.WebApp/Pages/User.razor
Normal file
@@ -0,0 +1,25 @@
|
||||
@page "/user"
|
||||
@attribute [Authorize]
|
||||
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<div class="d-flex flex-column m-3">
|
||||
<h3>User <b>@context.User.Identity?.Name</b></h3>
|
||||
<div>
|
||||
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Logout" IconColor="Color.Secondary" Size="Size.Large" OnClick="BeginLogOut">Logout</MudButton>
|
||||
</div>
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
|
||||
@code {
|
||||
|
||||
public void BeginLogOut()
|
||||
{
|
||||
Navigation.NavigateToLogout("authentication/logout");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user