2023-02-07 20:21:38 +00:00
|
|
|
@page "/modmenu"
|
|
|
|
@using ImageBoardServerApp.Auth
|
|
|
|
@inject AuthenticationStateProvider authStateProvider
|
|
|
|
@inject NavigationManager navManager
|
|
|
|
|
|
|
|
|
|
|
|
<h3>ModMenu</h3>
|
|
|
|
<AuthorizeView>
|
|
|
|
<Authorized>
|
|
|
|
<span>Welcome @mail to the mod menu</span>
|
|
|
|
<div>
|
|
|
|
<a href="/modmenu/reports">[Reports]</a>
|
2023-02-07 20:47:28 +00:00
|
|
|
<a href="/modmenu/users">[Users]</a>
|
2023-02-07 20:21:38 +00:00
|
|
|
</div>
|
|
|
|
</Authorized>
|
|
|
|
<NotAuthorized>
|
|
|
|
<a href="/login">You do not have permission to view this menu.</a>
|
|
|
|
</NotAuthorized>
|
|
|
|
</AuthorizeView>
|
|
|
|
@code {
|
|
|
|
private string mail { get; set; } = "";
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
{
|
|
|
|
var cauthStateProvder = (CustomAuthenticationStateProvider)authStateProvider;
|
|
|
|
var user = await cauthStateProvder.GetAuthenticationStateAsync();
|
|
|
|
if (user.User.Identity.IsAuthenticated)
|
|
|
|
{
|
|
|
|
mail = user.User.Identity.Name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|