mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-30 19:19:20 +01:00
fix(users) Handle missing email - OAuth (#1501)
* fix(users) patch OAuth default email issue - Intentionally omits setting email in constructor to trigger defaults when creating user. Handles cases where email is not authorized/given by provider. Related to issue #1250
This commit is contained in:
committed by
Michael Leanos
parent
89e8d13c47
commit
e3eafa6131
@@ -160,12 +160,16 @@ exports.saveOAuthUserProfile = function (req, providerUserProfile, done) {
|
||||
lastName: providerUserProfile.lastName,
|
||||
username: availableUsername,
|
||||
displayName: providerUserProfile.displayName,
|
||||
email: providerUserProfile.email,
|
||||
profileImageURL: providerUserProfile.profileImageURL,
|
||||
provider: providerUserProfile.provider,
|
||||
providerData: providerUserProfile.providerData
|
||||
});
|
||||
|
||||
// Email intentionally added later to allow defaults (sparse settings) to be applid.
|
||||
// Handles case where no email is supplied.
|
||||
// See comment: https://github.com/meanjs/mean/pull/1495#issuecomment-246090193
|
||||
user.email = providerUserProfile.email;
|
||||
|
||||
// And save the user
|
||||
user.save(function (err) {
|
||||
return done(err, user, info);
|
||||
|
||||
Reference in New Issue
Block a user