Improve error message for Graphql API (#7805)
 This improves this error message. --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -15,7 +15,9 @@ export const AuthUser = createParamDecorator(
|
|||||||
const request = getRequest(ctx);
|
const request = getRequest(ctx);
|
||||||
|
|
||||||
if (!options?.allowUndefined && !request.user) {
|
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;
|
return request.user;
|
||||||
|
|||||||
Reference in New Issue
Block a user