Skip to content
Permalink
Browse files
Update NPM Packages
  • Loading branch information
Johnny Lin committed Jul 21, 2020
1 parent 9512c00 commit 474d9470dc318b61101b6820aac7b1b5f77611dc
Show file tree
Hide file tree
Showing 3 changed files with 751 additions and 846 deletions.
@@ -82,7 +82,8 @@ router.post("/change-email",
.exists().withMessage("Missing password.")
.not().isEmpty().withMessage("Missing password.")
.custom((value, {req, location, path}) => {
return req.user.assertPassword(value);
return req.user.assertPassword(value)
.catch( error => Promise.reject())
}).withMessage("Incorrect password."),
validateCheck
],
@@ -149,7 +150,8 @@ router.post("/change-password",
.exists().withMessage("Missing current password.")
.not().isEmpty().withMessage("Missing current password.")
.custom((value, {req, location, path}) => {
return req.user.assertPassword(value);
return req.user.assertPassword(value)
.catch( error => Promise.reject())
}).withMessage("Current password is incorrect."),
body("newPassword")
.exists().withMessage("Missing new password.")

0 comments on commit 474d947

Please sign in to comment.