bulletboards/ImageBoardServerApp/Pages/Moderation/ModMenu.razor

31 lines
867 B
Text
Raw Normal View History

@page "/sys/modmenu"
2023-02-07 20:21:38 +00:00
@using ImageBoardServerApp.Auth
@inject AuthenticationStateProvider authStateProvider
@inject NavigationManager navManager
<AuthorizeView>
<Authorized>
<h3>ModMenu</h3>
2023-02-07 20:21:38 +00:00
<span>Welcome @mail to the mod menu</span>
<div>
<a href="/sys/reports">[Reports]</a>
<a href="/sys/users">[Users]</a>
2023-02-07 20:21:38 +00:00
</div>
</Authorized>
<NotAuthorized>
<DeadLink/>
2023-02-07 20:21:38 +00:00
</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;
}
}
}