my-server_1 | TypeError: res.setHeader is not a function
my-server_1 | at JwtGoogleStrategy.strategy.redirect (/myFolder/node_modules/passport/lib/middleware/authenticate.js:340:13)
my-server_1 | at stored (/myFolder/node_modules/passport-oauth2/lib/strategy.js:285:14)
my-server_1 | at NullStore.store (/myFolder/node_modules/passport-oauth2/lib/state/null.js:5:3)
my-server_1 | at JwtGoogleStrategy.OAuth2Strategy.authenticate (/myFolder/node_modules/passport-oauth2/lib/strategy.js:297:28)
my-server_1 | at attempt (/myFolder/node_modules/passport/lib/middleware/authenticate.js:378:16)
my-server_1 | at authenticate (/myFolder/node_modules/passport/lib/middleware/authenticate.js:379:7)
my-server_1 | at /myFolder/node_modules/@nestjs/passport/dist/auth.guard.js:88:3
my-server_1 | at new Promise (<anonymous>)
my-server_1 | at /myFolder/node_modules/@nestjs/passport/dist/auth.guard.js:80:83
my-server_1 | at GqlAuthGuard.canActivate (/myFolder/node_modules/@nestjs/passport/dist/auth.guard.js:44:32)
Is there an existing issue for this?
Current behavior
Currently this error occurs.
Minimum reproduction code
https://codesandbox.io/p/devbox/github/nestjs/typescript-starter/tree/master
Steps to reproduce
No response
Expected behavior
auth.resolver.ts This is part of the code.
GqlAuthGuard.ts
export const GqlAuthGuard = (name: string) => { return class GqlAuthGuard extends AuthGuard(name) { getRequest(context: ExecutionContext) { const gqlContext = GqlExecutionContext.create(context);
}; };
import { JwtModule } from '@nestjs/jwt'; import { UsersModule } from '../users/users.module'; import { JwtAccessStrategies } from './strategies/jwt-access.strategy'; import { JwtRefreshStrategies } from './strategies/jwt-refresh.strategy'; import { JwtGoogleStrategy } from './strategies/jwt-social-google.strategy';
@Module({ imports: [ JwtModule.register({}), // UsersModule, ],
providers: [ JwtAccessStrategies, JwtRefreshStrategies, JwtGoogleStrategy, AuthResolver, // AuthService, ], }) export class AuthModule {}
I don't think I'm wrong, but why does this error occur?
Package
Other package
No response
NestJS version
No response
Packages versions
Node.js version
No response
In which operating systems have you tested?
Other
No response