We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tried every possible combination found on forum, but it seems like its ignored completely.
Node version: 16.20
@nestjs/passport: ^10.0.2
passport-google-oauth2: ^0.2.0
import {Injectable} from '@nestjs/common'; import {ConfigService} from '@nestjs/config'; import {PassportStrategy} from '@nestjs/passport'; import {Strategy, VerifyCallback} from 'passport-google-oauth2'; import {GoogleProfile} from "./dto/auth-profile"; @Injectable() export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { constructor( protected configService: ConfigService, ) { super({ clientID: configService.get('GOOGLE_CLIENT_ID'), clientSecret: configService.get('GOOGLE_SECRET'), callbackURL: configService.get('GOOGLE_CALLBACK_URL'), scope: ['profile', 'email'], accessType: 'offline', prompt: 'select_account consent', approvalPrompt: 'force', authorizationURLParameters: { prompt: 'select_account consent', approvalPrompt: 'force', }, }); } async validate( _accessToken: string, _refreshToken: string, profile: any, done: VerifyCallback, ): Promise<any> { const {id, name, emails, photos} = profile; const user: GoogleProfile = { provider: 'google', providerId: id, email: emails[0].value, firstName: name.givenName, lastName: name.familyName, picture: photos[0].value, }; done(null, user); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Tried every possible combination found on forum, but it seems like its ignored completely.
Node version: 16.20
@nestjs/passport: ^10.0.2
passport-google-oauth2: ^0.2.0
The text was updated successfully, but these errors were encountered: