This commit is contained in:
Paul Schneider 2026-02-14 16:54:27 +00:00
commit 45514010f2
3505 changed files with 154 additions and 523 deletions

View file

@ -1,28 +0,0 @@
using System.Security.Claims;
namespace Yavsc.Server.Helpers
{
public static class UserHelpers
{
public static string GetUserId(this ClaimsPrincipal user)
{
return user.FindFirstValue("sub");
}
public static string GetUserName(this ClaimsPrincipal user)
{
return user.FindFirstValue("name");
}
public static bool IsSignedIn(this ClaimsPrincipal user)
{
return user.Identity.IsAuthenticated;
}
public static bool IsInMsRole(this ClaimsPrincipal user, string roleName)
{
return user.HasClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role", roleName);
}
}
}