fix: hash password for change user password
This commit is contained in:
@@ -144,7 +144,8 @@ class UserService {
|
|||||||
const userExist = await getUserByIdDb(id);
|
const userExist = await getUserByIdDb(id);
|
||||||
if (!userExist) throw new ErrorHandler(404, 'User not found');
|
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;
|
return result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new ErrorHandler(error.statusCode, error.message);
|
throw new ErrorHandler(error.statusCode, error.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user