From 0f6ed4fe66ff1fadf7f06641d4a538c7377893f7 Mon Sep 17 00:00:00 2001 From: patrickjieraldjuan Date: Sun, 28 Jan 2024 13:07:51 +0800 Subject: [PATCH] reverted to before changing resetPassword controller --- controllers/userControllers.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/controllers/userControllers.js b/controllers/userControllers.js index a6e1d11..55cf989 100644 --- a/controllers/userControllers.js +++ b/controllers/userControllers.js @@ -149,16 +149,6 @@ module.exports.resetPassword = async (req, res) => { // Get the new password from the request body const { newPassword } = req.body; - User.findOne({email : req.user.email}).then(result => - - const isPasswordEqualtoOld = bcrypt.compareSync(newPassword, result.password); - - if(isPasswordEqualtoOld){ - - return response.send({message: "New password should not be same with old password"}); - - } - // Hash the new password const hashedPassword = await bcrypt.hash(newPassword, 10);