`User.login`: don't use `defaultError` in case when error occurred in `user.hasPassword` -- response should be with status code 500

This commit is contained in:
Vladimir Shushkov 2015-12-20 04:26:25 +10:00
parent 69940ad3b0
commit a14afc9115
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ module.exports = function(User) {
user.hasPassword(credentials.password, function(err, isMatch) {
if (err) {
debug('An error is reported from User.hasPassword: %j', err);
fn(defaultError);
fn(err);
} else if (isMatch) {
if (self.settings.emailVerificationRequired && !user.emailVerified) {
// Fail to log in if email verification is not done yet