Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attemptsField should be selected when selectFields is specified #129

Open
dongyingtao opened this issue Apr 2, 2016 · 0 comments
Open

Comments

@dongyingtao
Copy link

When selectFields option is specified and limitAttempts is set to true, the wrong password authentication will failed with CAST error. This is because the attemptsField is not really selected by the query. When it tries to increment attempts by 1, that would always be (undefined+1)=>NaN which cannot be cast to a Number.

As hashField, the attemptsField is internally used by passport-local-mongoose. When it is necessary, passport-local-mongoose should add it to the selected fields like hashField and saltField. This should be a simple fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants