oops!
This commit is contained in:
parent
f9b239657c
commit
3f3653b180
|
@ -66,9 +66,12 @@ function setupPassport(passport: PassportStatic) {
|
||||||
const googleMail = profile.emails && profile.emails[0].value;
|
const googleMail = profile.emails && profile.emails[0].value;
|
||||||
if (googleMail) {
|
if (googleMail) {
|
||||||
const otherAccountWSameEmail = await getLingdocsUser("email", googleMail);
|
const otherAccountWSameEmail = await getLingdocsUser("email", googleMail);
|
||||||
otherAccountWSameEmail && await updateLingdocsUser(otherAccountWSameEmail?.userId, { google: gProfile });
|
console.log("found user with same gmail email");
|
||||||
|
if (otherAccountWSameEmail) {
|
||||||
|
await updateLingdocsUser(otherAccountWSameEmail.userId, { google: gProfile });
|
||||||
return done(null, otherAccountWSameEmail);
|
return done(null, otherAccountWSameEmail);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const u = await updateLingdocsUser(req.user.userId, { google: gProfile });
|
const u = await updateLingdocsUser(req.user.userId, { google: gProfile });
|
||||||
if (!u.email) {
|
if (!u.email) {
|
||||||
// if the user is adding a google account and doesn't have a previous email, add the google email
|
// if the user is adding a google account and doesn't have a previous email, add the google email
|
||||||
|
|
Loading…
Reference in New Issue