refactor: refactored gql-auth-guard to work for websocket based subscriptions
This commit is contained in:
parent
a6d6589811
commit
965fdad8b1
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import { AuthGuard } from '@nestjs/passport';
|
|||
export class GqlAuthGuard extends AuthGuard('jwt') {
|
||||
getRequest(context: ExecutionContext) {
|
||||
const ctx = GqlExecutionContext.create(context);
|
||||
return ctx.getContext().req;
|
||||
const { req, headers } = ctx.getContext();
|
||||
return headers ? headers : req;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue