Merged in fix/dtmc-debugging (pull request #2683)

Chore: DTMC Logging

* chore: DTMC debugging

* fix: prune dtmc logging

* fix: Add id's from azure in error logging


Approved-by: Linus Flood
Approved-by: Matilda Landström
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-08-21 13:12:56 +00:00
parent 2064732e56
commit 6a0675525d
2 changed files with 14 additions and 0 deletions

View File

@@ -88,6 +88,8 @@ async function linkEmployeeToUser(
case 403: case 403:
queryParam = "forbidden" queryParam = "forbidden"
break break
case 500:
queryParam = "internal_server_error"
} }
return { return {
success: false, success: false,

View File

@@ -88,11 +88,23 @@ const config = {
) { ) {
const employeeId = profile["user.employeeid"] const employeeId = profile["user.employeeid"]
if (employeeId && typeof employeeId === "string") { if (employeeId && typeof employeeId === "string") {
logger.info(
"[auth.dtmc] DTMC authentication successful - employeeId extracted"
)
return { return {
access_token: "", // JWT requires it, but DTMC does not need it, so save on cookie size by using empty string access_token: "", // JWT requires it, but DTMC does not need it, so save on cookie size by using empty string
loginType: "dtmc", loginType: "dtmc",
employeeId, employeeId,
} }
} else {
logger.error(
"[auth.dtmc] DTMC authentication failed - no employeeId found in Microsoft profile. Check Azure app registration optional claims configuration.",
{
userObjectId: profile.oid,
tenantId: profile.tid,
clientId: profile.aud,
}
)
} }
} }