@inherits LayoutComponentBase
@using System.Security.Claims;
@inject AuthenticationStateProvider AuthenticationStateProvider
@code {
ClaimsPrincipal User;
protected override async Task OnInitializedAsync()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
if (authState.User.Identity.IsAuthenticated)
User = authState.User;
}
}