Преглед изворни кода

serialize user and fix i18n

jam411 пре 3 година
родитељ
комит
f4da6a886a

+ 1 - 1
packages/app/public/static/locales/en_US/admin.json

@@ -755,7 +755,7 @@
     "reset_password": "Reset Password",
     "reset_password_modal": {
       "password_never_seen": "The temporary password can never be retrieved after this screen is closed.",
-      "password_reset_message": "Let the user know the new password below and strongly recommend to change another one immediately.",
+      "password_reset_message": "The temporary password was sent to the below user and strongly recommend to change another one immediately.",
       "send_new_password": "Please send the new password to the user.",
       "target_user": "Target User",
       "new_password": "New Password"

+ 1 - 1
packages/app/public/static/locales/ja_JP/admin.json

@@ -763,7 +763,7 @@
     "reset_password": "パスワードのリセット",
     "reset_password_modal": {
       "password_never_seen": "表示されたパスワードはこの画面を閉じると二度と表示できませんのでご注意ください。",
-      "password_reset_message": "対象ユーザーに下記のパスワードを伝え、すぐに新しく別のパスワードを設定するよう伝えてください。",
+      "password_reset_message": "対象ユーザーに一時的なパスワードを送信しました。新しく別のパスワードを設定するよう伝えてください。",
       "send_new_password": "新規発行したパスワードを、対象ユーザーへ連絡してください。",
       "target_user": "対象ユーザー",
       "new_password": "新しいパスワード"

+ 1 - 1
packages/app/public/static/locales/zh_CN/admin.json

@@ -763,7 +763,7 @@
     "reset_password": "重置密码",
     "reset_password_modal": {
       "password_never_seen": "The temporary password can never be retrieved after this screen is closed.",
-      "password_reset_message": "Let the user know the new password below and strongly recommend to change another one immediately.",
+      "password_reset_message": "The temporary password was sent to the below user and strongly recommend to change another one immediately.",
       "send_new_password": "Please send the new password to the user.",
       "target_user": "Target User",
       "new_password": "New Password"

+ 6 - 1
packages/app/src/server/routes/apiv3/users.js

@@ -872,7 +872,12 @@ module.exports = (crowi) => {
         },
       });
 
-      return res.apiv3({ user });
+      // return email only
+      const { email } = user;
+      const serializedUser = serializeUserSecurely(user);
+      serializedUser.email = email;
+
+      return res.apiv3({ user: serializedUser });
     }
     catch (err) {
       const msg = 'Error occurred during password reset request procedure.';