passport-ldapauth
passport-ldapauth copied to clipboard
"options.userNotFound" does not work
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;
...