bulletboards/ImageBoardServerApp/Pages/Moderation/ModMenu.razor

34 lines
964 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 Roles="Admin,Mod">
2023-02-07 20:21:38 +00:00
<Authorized>
<h3>ModMenu</h3>
<span>Welcome User #@mail to the mod menu</span>
2023-02-07 20:21:38 +00:00
<div>
<a href="/sys/modmenu/reports">[Reports]</a>
<a href="/sys/modmenu/users">[Users]</a>
<a href="/sys/modmenu/boards">[Boards]</a>
2023-02-07 20:21:38 +00:00
</div>
</Authorized>
<NotAuthorized>
<DeadLink/>
2023-02-07 20:21:38 +00:00
</NotAuthorized>
</AuthorizeView>
2023-02-07 20:21:38 +00:00
@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;
}
}
2023-02-07 20:21:38 +00:00
}