Do not automatically generate the user's email for password verification
This commit is contained in:
+3
-11
@@ -247,19 +247,11 @@ function verifyWithEmail(email, password, callback) {
|
||||
assert.strictEqual(typeof password, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
email = email.toLowerCase();
|
||||
|
||||
mail.get(config.fqdn(), function (error, mailConfig) {
|
||||
userdb.getByEmail(email.toLowerCase(), function (error, user) {
|
||||
if (error && error.reason == DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND));
|
||||
if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));
|
||||
|
||||
if (mailConfig.enabled) return verifyWithUsername(email.split('@')[0], password, callback);
|
||||
|
||||
userdb.getByEmail(email, function (error, user) {
|
||||
if (error && error.reason == DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND));
|
||||
if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));
|
||||
|
||||
verify(user.id, password, callback);
|
||||
});
|
||||
verify(user.id, password, callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user