15 lines
404 B
C#
15 lines
404 B
C#
using Microsoft.AspNetCore.Components.Authorization;
|
|
|
|
namespace StandManager.Utils;
|
|
|
|
public static class MembershipUtils
|
|
{
|
|
public static async Task<Guid> GetUserId(AuthenticationStateProvider auth)
|
|
{
|
|
var state = await auth.GetAuthenticationStateAsync();
|
|
var idClaim = state.User.FindFirst("UserId")?.Value;
|
|
|
|
return Guid.Parse(idClaim ?? Guid.Empty.ToString());
|
|
}
|
|
}
|