flaviuse / mern-authentication

MERN stack authentication boilerplate: password reset, email verification, server sessions, redux, typescript, hooks and docker for dev and prod.
https://mern-auth-client.herokuapp.com/login
MIT License
439 stars 95 forks source link

[Legacy] Log in not working #5

Closed Whizkevina closed 4 years ago

Whizkevina commented 4 years ago

Running the app locally, after creating an account when redirect to login, the login feature is not working, it's constantly complaining of "Invalid username or password", which the route in the API can be found in routes/auth.js on line 35... Does it mean the user round is not been saved or what...

flaviuse commented 4 years ago

Running the app locally, after creating an account when redirect to login, the login feature is not working, it's constantly complaining of "Invalid username or password", which the route in the API can be found in routes/auth.js on line 35... Does it mean the user round is not been saved or what...

Is the user validated on the DB ? Check your mongo DB to see if the user has been created

flaviuse commented 4 years ago

@Whizkevina Do you still encounter the issue ?

Whizkevina commented 4 years ago

@flaviuse, Yes I still encounter the issue on it...

flaviuse commented 4 years ago

@Whizkevina I could not reproduce your issue, local version is working well on my side, I'll update the code soon to have last versions of libraries.

The error "Invalid username or password" appear when the user provided for login is invalid meaning that it does not exist in your DB, check if the username exist in your DB with mongoDB compass.

image

You can try a fresh install with, make sure :

When registering you should have a new user and a token created in your DB : image image

Whizkevina commented 4 years ago

@flaviuse, thank you so much for your timely support. I appreciate it.

flaviuse commented 4 years ago

@Whizkevina No problem ;) If you need help don't hesitate