kaori 4 лет назад
Родитель
Сommit
56ae37c225

+ 3 - 2
src/client/js/components/PasswordResetExecutionForm.jsx

@@ -34,8 +34,9 @@ const PasswordResetExecutionForm = (props) => {
     }
 
     try {
-      await appContainer.apiv3Put('/forgot-password', {
-        token, newPassword, newPasswordConfirm,
+      // get endpoint by /forgot-password/${token} or window.location.pathname
+      await appContainer.apiv3Put(`/forgot-password/${token}`, {
+        /* token, */ newPassword, newPasswordConfirm,
       });
 
       setNewPassword('');

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

@@ -85,6 +85,7 @@ module.exports = (crowi) => {
     try {
       const userData = await user.updatePassword(newPassword);
       const serializedUserData = serializeUserSecurely(userData);
+      passwordResetOrder.isRevoked = true;
       return res.apiv3({ userData: serializedUserData });
     }
     catch (err) {