using System.Security.Claims;

namespace Shared.Excel;

public static class ImportIdentity
{
    public static string TenantId(ClaimsPrincipal user) =>
        user.FindFirst("tenant_id")?.Value
        ?? user.FindFirst("tenant")?.Value
        ?? "default";

    public static string UserId(ClaimsPrincipal user) =>
        user.FindFirst(ClaimTypes.NameIdentifier)?.Value
        ?? user.Identity?.Name
        ?? "unknown";
}
