bulletboards/ImageBoardServerApp/Pages/Moderation/ModMenu.razor
limited_dev ce201207d4 NOTE: temp commit, started rolling back changes to auth system
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
2023-06-12 20:46:44 +02:00

34 lines
No EOL
964 B
Text

@page "/sys/modmenu"
@using ImageBoardServerApp.Auth
@inject AuthenticationStateProvider authStateProvider
@inject NavigationManager navManager
<AuthorizeView Roles="Admin,Mod">
<Authorized>
<h3>ModMenu</h3>
<span>Welcome User #@mail to the mod menu</span>
<div>
<a href="/sys/modmenu/reports">[Reports]</a>
<a href="/sys/modmenu/users">[Users]</a>
<a href="/sys/modmenu/boards">[Boards]</a>
</div>
</Authorized>
<NotAuthorized>
<DeadLink/>
</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;
}
}
}