Refactor user ID handling in command handlers and update Protobuf package version to 0.0.124

This commit is contained in:
masoodafar-web
2025-11-20 23:18:07 +03:30
parent 0867244888
commit 8f25757307
18 changed files with 38 additions and 22 deletions

View File

@@ -13,7 +13,7 @@ public class CurrentUserService : ICurrentUserService
_httpContextAccessor = httpContextAccessor;
}
public string? UserId => _httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.NameIdentifier);
public long? UserId => long?.Parse(_httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.NameIdentifier) ?? throw new InvalidOperationException());
public string? FirstName => _httpContextAccessor.HttpContext?.User?.FindFirstValue("FirstName");
public string? LastName => _httpContextAccessor.HttpContext?.User?.FindFirstValue("LastName");
public string? MobileNumber => _httpContextAccessor.HttpContext?.User?.FindFirstValue("MobileNumber");