public override async Task <AuthenticationState> GetAuthenticationStateAsync() { var identity = new ClaimsIdentity(); UserDto userInfo = await _authApi.CurrentUserInfo(); if (userInfo.IsAuthenticated) { IEnumerable <Claim> claims = userInfo.Claims.SelectMany(c => c.Value.Select(v => new Claim(c.Key, v))); identity = new ClaimsIdentity(claims, "Server authentication"); } return(new AuthenticationState(new ClaimsPrincipal(identity))); }