Skip to content

Commit 2893734

Browse files
committed
Added claim type value to error so we can see in logs
1 parent db75115 commit 2893734

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

backend/src/middlewares/claim.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,19 @@ export function ClaimGuard(req: Request, _res: Response, next: NextFunction) {
3131
}
3232
break;
3333
default:
34-
console.log("Unsupported claim type:", context.env.CLAIM_TYPE);
3534
next(
3635
new UnauthorizedError(
3736
AuthorizationErrorCode.UNSUPPORTED_CLAIM_TYPE,
3837
context,
39-
'claim-middleware/validateRoute',
38+
`claim-middleware/validateRoute/${context.env.CLAIM_TYPE}`,
4039
),
4140
);
4241
}
43-
44-
console.log("Unsupported claim type:", context.env.CLAIM_TYPE);
4542
next(
4643
new UnauthorizedError(
4744
AuthorizationErrorCode.UNSUPPORTED_CLAIM_TYPE,
4845
context,
49-
'claim-middleware/validateRoute',
50-
),
46+
`claim-middleware/validateRoute/${context.env.CLAIM_TYPE}`,
47+
),
5148
);
5249
}

0 commit comments

Comments
 (0)