From b1e3c40b36d40d22113023af6b7485478b7ce47d Mon Sep 17 00:00:00 2001 From: Troplo Date: Fri, 12 Aug 2022 17:34:50 +1000 Subject: [PATCH] Update user.js --- backend/routes/user.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/routes/user.js b/backend/routes/user.js index 789b6ab..01d478d 100644 --- a/backend/routes/user.js +++ b/backend/routes/user.js @@ -511,12 +511,7 @@ router.put("/settings/:type", auth, async (req, res, next) => { id: req.user.id } }) - let match - if (user.password) { - match = await checkPasswordArgon2(req.body.password) - } else { - match = true - } + const match = await checkPasswordArgon2(req.body.current) if (match) { await user.update({ password: await argon2.hash(req.body.new)