-
Notifications
You must be signed in to change notification settings - Fork 294
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
Getting unauthorized user upon logging in with correct credentials #109
Comments
This has been happening with me sporadically as well in production. I've also noticed when I pull my production database down onto my local machine this happens. |
I resolved it months ago by just removing Passport Local Mongoose package and rewriting my own authentication strategy. And by the way using this package was imposing some boundaries into my app, for example there was only an option for logging in with username, but not email and etc. |
I am facing this issue, my dev database is remote. Locally when I try to log in the first time it fails. subsequent time it works. it works fine on production. |
Having the same issue in reverse, I.e in production does not work.
|
Facing the same issue and couldn't figure out why the issue even exists. |
I am getting unauthorized error even if I enter the correct user credentials for logging in. And even if I register a new user and then it tries to log in the user afterwards, it always fails with an 'unauthorized' message. And there is also something weird about it, that when the first time I registered a user and logged him it, it was successful, the very next day it fails to login.
I am using ExpressJS 4.13.1 with mongoose + passport + passport-local + passport-local-mongoose
here is my mongoose model
registering it in the app.js
in my routes/index.js
Now the first time I had written the code, the login and registration system seemed to be working just fine, until I started again on the very next day.
I am using Windows 8.1 x64
The text was updated successfully, but these errors were encountered: