Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error en el helpers.compararCredencial #1

Open
APossoC opened this issue Jul 12, 2019 · 1 comment
Open

Error en el helpers.compararCredencial #1

APossoC opened this issue Jul 12, 2019 · 1 comment

Comments

@APossoC
Copy link

APossoC commented Jul 12, 2019

Saludos,

puse en practica el tutorial muy instructivo y para aprender solo hize cambios de nombre de variables para familiarizarme con el, pero no entiendo por que la fuccion bcrypts.compare siempre regresa false, hubo alguna actualizan de la libreria bcrypts? gracias.

helpers.js>
image

console>
image

mysql>
image

Agradezco tu apoyo con el tema, muchas gracias.

@manwey
Copy link

manwey commented Apr 14, 2020

Yo creo que tu error es debido a que al cifrar la credencial a la función bcrypt.hash estas pasando el número 10, en lugar de pasarle la constante salt que tienes comentada.

const salt = await bcrypt.genSalt(10);
const hash = await bcrypt.hash(credencial, salt);

function genSalt(rounds?: number): Promise

Asynchronously generates a salt.
@param rounds — Number of rounds to use, defaults to 10 if omitted
@return — Promise with resulting salt, if callback has been omitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants