Add TokenUserInfo class and extend ClaimsPrincipal with methods for user claims retrieval
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m49s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m49s
This commit is contained in:
parent
b1df33dc20
commit
7e0f0485fd
5 changed files with 201 additions and 12 deletions
|
|
@ -144,7 +144,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
get
|
||||
{
|
||||
if (UserId != null || UserId != "")
|
||||
// First try to get from claims
|
||||
var ocIdFromClaims = OrgRootDnaId;
|
||||
if (ocIdFromClaims.HasValue && ocIdFromClaims.Value != Guid.Empty)
|
||||
return ocIdFromClaims.Value;
|
||||
|
||||
// Fallback to API call for backward compatibility
|
||||
if (UserId != null && UserId != "")
|
||||
return _userProfileRepository.GetUserOCId(Guid.Parse(UserId!), AccessToken);
|
||||
else
|
||||
return Guid.Empty;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue