Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"options.userNotFound" does not work #89

Open
wakabayashik opened this issue May 23, 2019 · 0 comments
Open

"options.userNotFound" does not work #89

wakabayashik opened this issue May 23, 2019 · 0 comments

Comments

@wakabayashik
Copy link

it seems that the option userNotFound for passport.authenticate() does not work.

if (err.name === 'InvalidCredentialsError' || err.name === 'NoSuchObjectError' || (typeof err === 'string' && err.match(/no such user/i))) {
var message;

I think above line should become like this;

      if (typeof err === 'string' && err.match(/no such user/i)) {
        var message = options.userNotFound || options.invalidCredentials || 'Invalid username/password';
        return this.fail({ message: message }, 401);
      }
      if (err.name === 'InvalidCredentialsError' || err.name === 'NoSuchObjectError') {
        var message; 
        ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant