Skip to content

Commit

Permalink
Merge pull request #3736 from uselagoon/remove-attribute-from-unautho…
Browse files Browse the repository at this point in the history
…rized

refactor: remove attribute from unauthorized response
  • Loading branch information
tobybellwood authored Sep 9, 2024
2 parents 268e5f5 + 8f1f273 commit 0797e9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions services/api/src/util/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,21 +356,21 @@ 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
}
);
}

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}"`
);
};
};

0 comments on commit 0797e9e

Please sign in to comment.