refactor: refactored gql-auth-guard to work for websocket based subscriptions

This commit is contained in:
Balu Babu
2023-02-08 14:20:51 +05:30
parent a6d6589811
commit 965fdad8b1

View File

@@ -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;
}
}