fix: hash password for change user password
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user