DEV Community

Discussion on: How to Implement Login with Google in Nest JS

Collapse
 
cziermann profile image
cziermann

i think i found an fix for that.
the problem is that the oauth2 strategy is looking for req.query.code

so one fix is just write the token in the req.query.code in the getRequest function

  getRequest(context: ExecutionContext) {
    const ctx = GqlExecutionContext.create(context);
    const req = ctx.getContext().req;
    req.query.code = tokenExtractor(req);
    return req;
  }
Enter fullscreen mode Exit fullscreen mode
Collapse
 
cziermann profile image
cziermann

did think that this fixes the issue but no.
does anyone has experience with nestjs + passport (google) and graphql?