@inherits LayoutComponentBase @using Microsoft.AspNetCore.Components.Authorization; @using System.Security.Claims; @inject AuthenticationStateProvider AuthenticationStateProvider @if (User?.Identity?.IsAuthenticated ?? false) { @User?.Identity.Name General Change Password Saves Logout } Dashboards Overview Average Session Playtime @if (User != null && User.IsInRole(RoleService.AdministratorRoleName)) { Games Metadata Collections Companies Engines Genres Platforms Tags Redistributables Servers Pages Edit View Issues Files Settings General Users Roles Authentication Appearance User Saves Archives Media IPX Relay Servers Beacon Tools Logs Launcher Updates } else { Pages }
@Body
@code { ClaimsPrincipal User; protected override async Task OnInitializedAsync() { var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); if (authState.User.Identity.IsAuthenticated) User = authState.User; } }