diff --git a/services/user.service.js b/services/user.service.js index 2131a8e..dc187af 100644 --- a/services/user.service.js +++ b/services/user.service.js @@ -144,7 +144,8 @@ class UserService { const userExist = await getUserByIdDb(id); if (!userExist) throw new ErrorHandler(404, 'User not found'); - const result = await changeUserPasswordDb(id, newPassword); + const hashedPassword = await hashPassword(newPassword); + const result = await changeUserPasswordDb(id, hashedPassword); return result; } catch (error) { throw new ErrorHandler(error.statusCode, error.message);