fix(Restwrite): Do not send verification email if users is authenticated using some auth provider (#2660) (#3882)
This commit is contained in:
committed by
Florent Vilmart
parent
31744c59ef
commit
6cc99aa193
@@ -444,9 +444,15 @@ RestWrite.prototype._validateEmail = function() {
|
||||
if (results.length > 0) {
|
||||
throw new Parse.Error(Parse.Error.EMAIL_TAKEN, 'Account already exists for this email address.');
|
||||
}
|
||||
// We updated the email, send a new validation
|
||||
this.storage['sendVerificationEmail'] = true;
|
||||
this.config.userController.setEmailVerifyToken(this.data);
|
||||
if (
|
||||
!this.data.authData ||
|
||||
!Object.keys(this.data.authData).length ||
|
||||
Object.keys(this.data.authData).length === 1 && Object.keys(this.data.authData)[0] === 'anonymous'
|
||||
) {
|
||||
// We updated the email, send a new validation
|
||||
this.storage['sendVerificationEmail'] = true;
|
||||
this.config.userController.setEmailVerifyToken(this.data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user