Registration no longer hangs on duplicate emails

There was a return missing. This closes #82 again.
This commit is contained in:
Gabor Javorszky 2013-06-10 21:26:20 +01:00
parent 4a630af54a
commit e0caddeee7

View File

@ -45,7 +45,7 @@
return this.forge({email_address: userData.email_address}).fetch().then(function (user) {
if (!!user.attributes.email_address) {
when.reject(new Error('A user with that email address already exists.'));
return when.reject(new Error('A user with that email address already exists.'));
}
return nodefn.call(bcrypt.hash, _user.password, null, null).then(function (hash) {