Skip to content

Commit

Permalink
Merge pull request hagopj13#68 from samkit5495/patch-1
Browse files Browse the repository at this point in the history
Update auth.service.js
  • Loading branch information
hagopj13 authored Jan 25, 2021
2 parents 707bbd4 + 1adf9d5 commit 38b4d10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/auth.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ const resetPassword = async (resetPasswordToken, newPassword) => {
if (!user) {
throw new Error();
}
await Token.deleteMany({ user: user.id, type: tokenTypes.RESET_PASSWORD });
await userService.updateUserById(user.id, { password: newPassword });
await Token.deleteMany({ user: user.id, type: tokenTypes.RESET_PASSWORD });
} catch (error) {
throw new ApiError(httpStatus.UNAUTHORIZED, 'Password reset failed');
}
Expand Down

0 comments on commit 38b4d10

Please sign in to comment.