laatzen/LaaProductionWeb/LaaProductionWeb.Blazor/Components/Identity/Services/IdentityStateProvider.cs
2025-03-17 16:03:24 +01:00

19 lines
609 B
C#

namespace LaaProductionWeb.Blazor.Components.Identity.Services
{
using Microsoft.AspNetCore.Components.Authorization;
using System.Threading.Tasks;
public class IdentityStateProvider(IdentityService identityService): AuthenticationStateProvider
{
private readonly IdentityService identityService = identityService;
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
{
var claimsPrincipal = await this.identityService.GetClaimsPrincipalAsync();
return new AuthenticationState(claimsPrincipal);
}
}
}