Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 38s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 38s
This commit is contained in:
commit
2187d9f3e6
1 changed files with 9 additions and 2 deletions
|
|
@ -160,6 +160,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Core
|
||||||
var token = context.Request.Headers["Authorization"];
|
var token = context.Request.Headers["Authorization"];
|
||||||
|
|
||||||
var pf = await GetProfileByKeycloakIdAsync(Guid.Parse(keycloakId), token);
|
var pf = await GetProfileByKeycloakIdAsync(Guid.Parse(keycloakId), token);
|
||||||
|
var _userFullname = string.Empty;
|
||||||
|
var _userName = string.Empty;
|
||||||
|
if (keycloakId != "00000000-0000-0000-0000-000000000000" && pf == null)
|
||||||
|
{
|
||||||
|
_userFullname = context.User?.FindFirst("name")?.Value;
|
||||||
|
_userName = context.User?.FindFirst("preferred_username")?.Value;
|
||||||
|
}
|
||||||
|
|
||||||
await _next(context); // ดำเนินการต่อไปยัง Middleware อื่น ๆ
|
await _next(context); // ดำเนินการต่อไปยัง Middleware อื่น ๆ
|
||||||
|
|
||||||
|
|
@ -260,8 +267,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Core
|
||||||
output = responseBodyJson,
|
output = responseBodyJson,
|
||||||
|
|
||||||
userId = keycloakId,
|
userId = keycloakId,
|
||||||
userName = $"{pf?.Prefix ?? ""}{pf?.FirstName ?? ""} {pf?.LastName ?? ""}",
|
userName = pf != null ? $"{pf?.Prefix ?? ""}{pf?.FirstName ?? ""} {pf?.LastName ?? ""}" : _userFullname ?? "",
|
||||||
user = pf?.CitizenId ?? ""
|
user = pf != null ? pf?.CitizenId ?? "" : _userName ?? ""
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue