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

Give error on Missing Credentials instead of info

Open rkt2spc opened this issue 7 years ago • 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')
  ...
})

rkt2spc avatar Jul 04 '17 01:07 rkt2spc

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

Hum4n01d avatar Aug 31 '18 21:08 Hum4n01d