Skip to content

Tag: bcrypt

Bcrypt.compare always returns true

I am using NestJS and Passport to create a simple log in/registration form and I am using bcrypt to see if the password that has been hashed is matching the password that user provides in the login form, but it always returns true In the code above, even if I set the argument as a string it will return true

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 but when i give post request . It says users is not defined at pls find an solution for this . I am sorry if it is a silly or

bcrypt Error: data and hash arguments required

I am getting a bcrypt error stating that data and hash arguments are required, referencing line #44 in my routes.js file. From what I can tell, I am passing that information: the first parameter to bcrypt.compare is the user entered password, and the second is the hashed password retrieved from the db. What a…