19 lines
609 B
C#
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);
|
|
}
|
|
}
|
|
}
|