Skip to content
Advertisement

users is not defined in nodejs at bcrypt.compare


I am doing the following thing in node js


1.register and save user in mongodb 2.generate token when registered. 3.authorization using token 4.login user and


this is my router file


JavaScript

but when i give post request . It says users is not defined at

JavaScript

pls find an solution for this . I am sorry if it is a silly or bad question . thanks

Advertisement

Answer

You didn’t identify “Users” so you can chick as:

JavaScript

//It will store found user and chick if user email existed if yes it will chick password

I hope that helps 😊

Advertisement