Update user.js

This commit is contained in:
Troplo 2022-08-12 18:14:15 +10:00
parent b1e3c40b36
commit eaf54b2863

View file

@ -511,7 +511,7 @@ router.put("/settings/:type", auth, async (req, res, next) => {
id: req.user.id
}
})
const match = await checkPasswordArgon2(req.body.current)
const match = await checkPasswordArgon2(req.body.current, user.password)
if (match) {
await user.update({
password: await argon2.hash(req.body.new)