Skip to content

Commit

Permalink
Improve error message for Graphql API (#7805)
Browse files Browse the repository at this point in the history
![CleanShot 2024-10-17 at 11 39
39](https://github.com/user-attachments/assets/616b8317-de1f-4b61-b2b4-980b14b09f66)

This improves this error message.

---------

Co-authored-by: Félix Malfait <[email protected]>
  • Loading branch information
thibaultleouay and FelixMalfait authored Oct 17, 2024
1 parent a45d314 commit 249c732
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const AuthUser = createParamDecorator(
const request = getRequest(ctx);

if (!options?.allowUndefined && !request.user) {
throw new ForbiddenException("You're not authorized to do this");
throw new ForbiddenException(
"You're not authorized to do this. Note: This endpoint requires a user and won't work with just an API key.",
);
}

return request.user;
Expand Down

0 comments on commit 249c732

Please sign in to comment.