Skip to content

Commit

Permalink
refactor: remove attribute from unauthorized response
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jun 7, 2024
1 parent 38fd482 commit 8f1f273
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 @@ -349,21 +349,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 8f1f273

Please sign in to comment.