Просмотр исходного кода

check if password confirmation matches password

kaori 4 лет назад
Родитель
Сommit
2b7fce901e

+ 1 - 1
src/client/js/components/PasswordResetExecutionForm.jsx

@@ -34,7 +34,7 @@ const PasswordResetExecutionForm = (props) => {
 
 
     try {
     try {
       await appContainer.apiv3Put('/forgot-password', {
       await appContainer.apiv3Put('/forgot-password', {
-        email, newPassword,
+        email, newPassword, newPasswordConfirm,
       });
       });
 
 
       setNewPassword('');
       setNewPassword('');

+ 1 - 0
src/server/routes/apiv3/forgot-password.js

@@ -19,6 +19,7 @@ module.exports = (crowi) => {
       body('newPassword').isString().not().isEmpty()
       body('newPassword').isString().not().isEmpty()
         .isLength({ min: 6 })
         .isLength({ min: 6 })
         .withMessage('password must be at least 6 characters long'),
         .withMessage('password must be at least 6 characters long'),
+      // checking if password confirmation matches password
       body('newPasswordConfirm').isString().not().isEmpty()
       body('newPasswordConfirm').isString().not().isEmpty()
         .custom((value, { req }) => {
         .custom((value, { req }) => {
           return (value === req.body.newPassword);
           return (value === req.body.newPassword);