Hash verify always returns false
jericopulvera opened this issue · 3 comments
jericopulvera commented
My hooks on save
this.addHook('preSave', async function() {
this.password = await Hash.make(this.password)
})
const { email, password } = request.all()
const user = await User.findOne({
email: email,
confirmed: true
})
const passwordIsCorrect = await Hash.verify(password, user.password)
console.log(passwordIsCorrect)
what might be the reason for this?
jericopulvera commented
Sorry I realized that I was hashing 2 times before saving.
HernandoPinzon commented
Sorry I realized that I was hashing 2 times before saving.
Same happen to me
brunojoao commented
me too, doesnot work, forever false