Skip to content

Commit

Permalink
Fixed bug for handling errors during password's registerUser step.
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoguchi committed May 3, 2011
1 parent 9472fe2 commit 17cffcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/everymodule.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var everyModule = module.exports = {
// For example, when we set and try to access a scope in an auth module definition
// but if you look in index, everyauth is not assigned to the module until after it is
// required
if (this.everyauth.debug && 'undefined' === typeof this[k]) {
if (this.everyauth && this.everyauth.debug && 'undefined' === typeof this[k]) {
var debugErr = new Error('You are trying to access the attribute/method configured by `' + property + '`, which you did not configure. Time to configure it.');
console.log(debugErr.stack);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/password.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ everyModule.submodule('password')
.accepts('newUserAttributes')
.promises('userOrErrors')
.step('extractUserOrHandleErrors') // User registration may throw an error if DB detects a non-unique value for login
.accepts('userOrErrors newUserAttributes')
.accepts('req res userOrErrors newUserAttributes')
.promises('user')
.canBreakTo('registrationFailSteps')
.step('getSession')
Expand Down Expand Up @@ -172,7 +172,7 @@ everyModule.submodule('password')
return this.breakTo('registrationFailSteps', req, res, errors, user);
}
})
.extractUserOrHandleErrors( function (userOrErrors, newUserAttributes) {
.extractUserOrHandleErrors( function (req, res, userOrErrors, newUserAttributes) {
var errors, user;
if (Array.isArray(userOrErrors)) {
errors = userOrErrors;
Expand Down

0 comments on commit 17cffcb

Please sign in to comment.