diff --git a/services/api/src/util/auth.ts b/services/api/src/util/auth.ts index 428b84bb0e..cd6354d617 100644 --- a/services/api/src/util/auth.ts +++ b/services/api/src/util/auth.ts @@ -356,7 +356,8 @@ export const keycloakHasPermission = (grant, requestCache, modelClients, service userActivityLogger.user_info( `User does not have permission to '${scope}' on '${resource}'`, { - user: currentUser.id + user: currentUser.id, + attributes: attributes } ); } @@ -364,13 +365,12 @@ export const keycloakHasPermission = (grant, requestCache, modelClients, service userActivityLogger.user_info( `User does not have permission to '${scope}' on '${resource}'`, { - user: grant.access_token.content + user: grant.access_token.content, + attributes: attributes } ); throw new KeycloakUnauthorizedError( - `Unauthorized: You don't have permission to "${scope}" on "${resource}": ${JSON.stringify( - attributes - )}` + `Unauthorized: You don't have permission to "${scope}" on "${resource}"` ); }; };