Open BanovMiroslav opened 9 years ago
@jaredhanson
+1 for this. This is obviously a bug! jaredhanson/passport#466
However I think you should simply use this.error
instead of removing it in this line:
https://github.com/jaredhanson/passport-local/blob/master/lib/strategy.js#L75
@Fonger Then you're assuming that not having a username or password is an error, which might not always be the case. Determining this is the job of the verify callback, imo.
@BanovMiroslav if you make a PR against https://github.com/passport-next/passport-local this will get looked into.
When not adding a user and pass, there is a specific error being sent. But this case is already handled by the verify callback, and it is easier and more natural to send a prettier error response to the end-user if there is no special handling of the case where user and password are not provided.