Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes to post-login-failure password resets #74

Merged
merged 1 commit into from

1 participant

@AvianFlu

This patch is meant to address two things.

First, when the reset prompt properties were moved to properties.js, the property.name changed from reset to request password reset - this was throwing off the match, and preventing the reset emails from ever getting sent.

Second, I was returning an error after the reset because of the way Jitsu's call stack appears to work. If one calls callback with no arguments, the command that Jitsu was attempting to run before asking for credentials is counted as having succeeded, which can lead to some genuinely strange UI messages. This is the output if the callback is called without arguments:

  info:   Request password reset for: aviantestertwo
  info:   Check your email for instructions on resetting your password.
  info:   Successfully configured user aviantestertwo
  info:   Executing command list
  error:  Unable to Authenticate as aviantestertwo
  error:  Nodejitsu Error (403): Not Authorized
  info:   Nodejitsu not ok

If an error is returned, on the other hand:

  info:   Request password reset for: aviantestertwo
  info:   Check your email for instructions on resetting your password.
  error:  Error running command list
  info:   Nodejitsu not ok
@AvianFlu

I have confirmed that this issue is still present with HEAD as of five minutes ago; I'm going to merge this.

@AvianFlu AvianFlu merged commit 5a36744 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 13, 2011
  1. @AvianFlu
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/jitsu.js
  2. +1 −1  lib/jitsu/commands/users.js
View
2  lib/jitsu.js
@@ -216,7 +216,7 @@ jitsu.setupUserNoWarn = function(callback) {
if (err) {
return callback(err);
}
- if (/^y[es]*/i.test(res.reset)) {
+ if (/^y[es]?/i.test(res['request password reset'])) {
return jitsu.commands.run(['users', 'forgot', username], callback);
}
View
2  lib/jitsu/commands/users.js
@@ -231,7 +231,7 @@ users.forgot = function (username, shake, callback) {
}
winston.info('Check your email for instructions on resetting your password.');
- callback();
+ callback(new Error('Password reset pending, cannot login.'));
});
};
Something went wrong with that request. Please try again.