Skip to content

Commit

Permalink
Fixed username logic in Google SSO.
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash committed Jul 11, 2024
1 parent 7ec2261 commit b56415e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/service/passport/strategies/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ class GoogleStrategy {
customData = "{}";
log.warn("Invalid JSON found in `user.account-creation.custom-data.default-value`.");
}
let username = profile.username;
if (!username) {
username = profile.emails[0].value.split("@")[0];
}
const newUser = new UserModel({
email: profile.emails[0].value,
email: username,
firstName: profile.name.givenName,
lastName: profile.name.familyName,
username: profile.emails[0].value,
Expand Down

0 comments on commit b56415e

Please sign in to comment.