Skip to content
Advertisement

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

Gettting an undefined value from bcrypt hash function

Ok, I’m getting an undefined value from a function, I don’t know why, I’m trying to get the value of a password hash for insert in the database, but the const that have the function has the value “undefined”, so what I should change in my code? Answer When you call bcrypt.hash() and pass in a callback function, no Promise

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 am I doing wrong? routes.js Answer bcrypt.compare

Advertisement