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

Merge pull request #4204 from weseek/fix/gw7246-handring-post-method-when-user-is-not-found

removed throwing err
cao 4 лет назад
Родитель
Сommit
604c275dfe

+ 13 - 0
packages/app/resource/locales/en_US/notifications/notActiveUser.txt

@@ -0,0 +1,13 @@
+Password Reset
+
+Hi, {{ email }}
+
+A request has been received to change the password from {{ appTitle }}.
+However, this email is not registerd. Please try again with different email.
+
+If you did not request a password reset, you can safely ignore this email.
+
+-------------------------------------------------------------------------
+
+GROWI: {{ appTitle }}
+URL: {{ url }}

+ 0 - 4
packages/app/resource/locales/en_US/notifications/passwordReset.txt

@@ -8,7 +8,3 @@ To reset your password, click on the link below.
 {{ url }}
 
 If you did not request a password reset, you can safely ignore this email.
-
-
-Thank you,
-The GROWI Developer Team

+ 13 - 0
packages/app/resource/locales/ja_JP/notifications/notActiveUser.txt

@@ -0,0 +1,13 @@
+パスワードリセット
+
+こんにちは、 {{ email }}
+
+{{ appTitle }} からパスワード再設定のリクエストがありましたが、このemailは登録されておりません。
+他のemailアドレスで再度お試しください。
+
+もしこのリクエストに心当たりがない場合は、このメールを無視してください。
+
+-------------------------------------------------------------------------
+
+GROWI: {{ appTitle }}
+URL: {{ url }}

+ 0 - 2
packages/app/resource/locales/ja_JP/notifications/passwordReset.txt

@@ -8,5 +8,3 @@
 {{ url }}
 
 もしこのリクエストに心当たりがない場合は、このメールを無視してください。
-
-GROWI開発チームより

+ 13 - 0
packages/app/resource/locales/zh_CN/notifications/notActiveUser.txt

@@ -0,0 +1,13 @@
+重设密码
+
+嗨,{{电子邮件}}
+
+已收到来自 {{appTitle}} 的更改密码请求。
+但是,此电子邮件未注册。请使用其他电子邮件重试。
+
+如果您没有要求重置密码,则可以放心地忽略此电子邮件。
+
+-------------------------------------------------------------------------
+
+GROWI: {{ appTitle }}
+URL: {{ url }}

+ 0 - 2
packages/app/resource/locales/zh_CN/notifications/passwordReset.txt

@@ -8,5 +8,3 @@
 {{ url }}
 
 如果您没有要求重置密码,则可以放心地忽略此电子邮件。
-
-GROWI 开发团队

+ 2 - 1
packages/app/src/server/routes/apiv3/forgot-password.js

@@ -62,7 +62,8 @@ module.exports = (crowi) => {
 
       // when the user is not found or active
       if (user == null || user.status !== 2) {
-        return res.apiv3Err('User not found or active');
+        await sendPasswordResetEmail('notActiveUser', i18n, email, appUrl);
+        return res.apiv3();
       }
 
       const passwordResetOrderData = await PasswordResetOrder.createPasswordResetOrder(email);