Skip to content

Commit

Permalink
Merge pull request #69 from abinth11/bug-fix-gogle-auth
Browse files Browse the repository at this point in the history
name issue fixed in google auth
  • Loading branch information
abinth11 authored Aug 11, 2023
2 parents 5de9ece + fea0c9c commit 40f3de5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions server/src/frameworks/services/googleAuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ export const googleAuthService = () => {
audience: configKeys.GOOGLE_CLIENT_ID,
});
const payload = ticket.getPayload();
if (payload?.given_name && payload.email && payload.picture) {
const nameParts = payload.given_name.trim().split(" ");
const firstName = nameParts[0];
const lastName = nameParts.slice(1).join(" ");
user.firstName = firstName;
user.lastName = lastName;
if (payload?.given_name&&payload?.family_name&& payload.email && payload.picture) {
user.firstName =payload.given_name;
user.lastName = payload.family_name;
user.email = payload.email;
user.profilePic.url = payload.picture
user.profilePic.name=payload.given_name
Expand Down

0 comments on commit 40f3de5

Please sign in to comment.