feat: migrate snowflake ids and refresh migrations
This commit is contained in:
@@ -20,23 +20,23 @@ public sealed class HttpContextCurrentUserAccessor : ICurrentUserAccessor
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid UserId
|
||||
public long UserId
|
||||
{
|
||||
get
|
||||
{
|
||||
var principal = _httpContextAccessor.HttpContext?.User;
|
||||
if (principal == null || !principal.Identity?.IsAuthenticated == true)
|
||||
{
|
||||
return Guid.Empty;
|
||||
return 0;
|
||||
}
|
||||
|
||||
var identifier = principal.FindFirstValue(ClaimTypes.NameIdentifier)
|
||||
?? principal.FindFirstValue("sub");
|
||||
|
||||
return Guid.TryParse(identifier, out var id) ? id : Guid.Empty;
|
||||
return long.TryParse(identifier, out var id) ? id : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsAuthenticated => UserId != Guid.Empty;
|
||||
public bool IsAuthenticated => UserId != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user