passport-ldapauth icon indicating copy to clipboard operation
passport-ldapauth copied to clipboard

"options.userNotFound" does not work

Open wakabayashik opened this issue 5 years ago • 0 comments

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

https://github.com/vesse/passport-ldapauth/blob/0467cc3613461cba7952ead352b59a6ac5de5845/lib/passport-ldapauth/strategy.js#L283-L284

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; 
        ...

wakabayashik avatar May 23 '19 04:05 wakabayashik