From 7e05fc589b808eba28d0fee91eccadee918ae388 Mon Sep 17 00:00:00 2001 From: Antony Kurniawan Date: Wed, 15 Oct 2025 11:14:32 +0700 Subject: [PATCH] fix: hash password for change user password --- services/user.service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);