V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace Kbx.Shared.Runtime;
|
||||
|
||||
public static class RuntimeIdentity
|
||||
{
|
||||
public static Guid TenantId(ClaimsPrincipal user) => Parse(user.FindFirst("tenant_id")?.Value ?? user.FindFirst("tenant")?.Value);
|
||||
public static Guid UserId(ClaimsPrincipal user) => Parse(user.FindFirst(ClaimTypes.NameIdentifier)?.Value);
|
||||
|
||||
private static Guid Parse(string? value) => Guid.TryParse(value, out var id) ? id : Guid.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user