Closed rickdana closed 9 years ago
I faced this issue once. Check the lengths of the generated hash and the one you address storing. E.g. The generated hash from bcrypt is 60 letters but you are storing only 50(say), then comparison issues will come.
thank u i got it solve. the problem was the length of my password in my db
Length Alert :)
Hello, I'm implementing an user auth with Bcrypt. I'm facing an issue when comparing the given password with the one store in my DB i always have a false message. here is my compare method :
bcrypt.compare(param.motdepasse , client.motdepasse, function(err, pass) { if(err) res.json(200,{Message :'Error'}); if(pass == true){ client.isAuthenticate = 'true'; res.json(client); }else{ res.json(200,{Message :'Mot de passe érronée !'}); }
Please any idea? thk!