Skip to content

Commit

Permalink
fix: last name is undefined when using google (#597)
Browse files Browse the repository at this point in the history
fix: last name

Co-authored-by: orig <[email protected]>
  • Loading branch information
origranot and orig authored Dec 9, 2023
1 parent f77ea56 commit 85ca748
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/backend/src/auth/strategies/google.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
return done(new Error('Email is not verified'));
}

const fullName = `${name?.givenName}${name?.familyName ? ` ${name?.familyName}` : ''}`;

const user = {
email: emails[0].value,
fullName: `${name.givenName} ${name.familyName}`,
fullName,
picture: photos[0].value,
accessToken,
refreshToken,
Expand Down

0 comments on commit 85ca748

Please sign in to comment.