jaredhanson/passport-local

Give error on Missing Credentials instead of info

rkt2spc opened this issue · 1 comments

I suggest we return error on Missing Credentials instead of return { message: 'missing credentials' } to info, it feels kinda odd

passport.authenticate('local', (err, user) => {
  if (err typeof require('passport-local/errors/MissingCredentials'))
  ...
})

Instead of

passport.authenticate('local', (err, user, info) => {
  if (!err && !user && info && info.message == 'Missing Credentials')
  ...
})

This is a pretty annoying error to debug, it would be helpful if an error was thrown, but at the same time, there's it isn't really an error; if somebody sends a malformed request, the problem is on their side, not the server's