Ensure lowercasing the email

This commit is contained in:
Johannes Zellner
2016-09-27 16:21:18 +02:00
parent 23bf358bbe
commit ea87b3e876

View File

@@ -264,8 +264,10 @@ function verifyWithEmail(email, password, callback) {
assert.strictEqual(typeof password, 'string');
assert.strictEqual(typeof callback, 'function');
email = email.toLowerCase();
function checkWithEmailFromDatabase() {
userdb.getByEmail(email.toLowerCase(), function (error, user) {
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));