diff --git a/packages/hoppscotch-backend/src/decorators/gql-user.decorator.ts b/packages/hoppscotch-backend/src/decorators/gql-user.decorator.ts index 03c8fffe1..71042e069 100644 --- a/packages/hoppscotch-backend/src/decorators/gql-user.decorator.ts +++ b/packages/hoppscotch-backend/src/decorators/gql-user.decorator.ts @@ -4,7 +4,7 @@ import { GqlExecutionContext } from '@nestjs/graphql'; export const GqlUser = createParamDecorator( (data: unknown, context: ExecutionContext) => { const ctx = GqlExecutionContext.create(context); - return ctx.getContext().req.user; + const { req, headers } = ctx.getContext(); + return headers ? headers.user : req.user; }, ); -