@inherits LayoutComponentBase @using Microsoft.AspNetCore.Components.Authorization; @using System.Security.Claims; @inject AuthenticationStateProvider AuthenticationStateProvider @inject NavigationManager NavigationManager @if (User?.Identity?.IsAuthenticated ?? false) { @User?.Identity.Name General Library Connected Accounts 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 Scripts 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; } }