From 15d08564c8cb553e48677daee20648d076323424 Mon Sep 17 00:00:00 2001 From: syuilo <syuilotan@yahoo.co.jp> Date: Tue, 29 Aug 2017 02:46:28 +0900 Subject: [PATCH] #739 --- CHANGELOG.md | 4 ++++ locales/en.yml | 2 ++ locales/ja.yml | 2 ++ src/web/app/desktop/tags/dialog.tag | 3 +++ src/web/app/desktop/tags/settings.tag | 19 ++++++++++++++----- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc0442ba01..8a310513bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ChangeLog ========= 主に notable な changes を書いていきます +unreleased +---------- +* New: パスワードを変更する際に新しいパスワードを二度入力させる (#739) + 2470 (2017/08/29) ----------------- * New: トークンを再生成できるように (#497) diff --git a/locales/en.yml b/locales/en.yml index a24b8725ae..439b7ef069 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -212,6 +212,8 @@ desktop: reset: "Change your password" enter-current-password: "Enter the current password" enter-new-password: "Enter the new password" + enter-new-password-again: "Enter the new password again" + not-match: "New password not matched" changed: "Password updated successfully" mk-post-form: diff --git a/locales/ja.yml b/locales/ja.yml index 88e0b76d82..258e192394 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -212,6 +212,8 @@ desktop: reset: "パスワードを変更する" enter-current-password: "現在のパスワードを入力してください" enter-new-password: "新しいパスワードを入力してください" + enter-new-password-again: "もう一度新しいパスワードを入力してください" + not-match: "新しいパスワードが一致しません" changed: "パスワードを変更しました" mk-post-form: diff --git a/src/web/app/desktop/tags/dialog.tag b/src/web/app/desktop/tags/dialog.tag index 9905123eeb..743fd63942 100644 --- a/src/web/app/desktop/tags/dialog.tag +++ b/src/web/app/desktop/tags/dialog.tag @@ -44,6 +44,9 @@ // color #43A4EC font-weight bold + &:empty + display none + > i margin-right 0.5em diff --git a/src/web/app/desktop/tags/settings.tag b/src/web/app/desktop/tags/settings.tag index 80a42d6652..eabddfb432 100644 --- a/src/web/app/desktop/tags/settings.tag +++ b/src/web/app/desktop/tags/settings.tag @@ -256,6 +256,7 @@ </style> <script> import passwordDialog from '../scripts/password-dialog'; + import dialog from '../scripts/dialog'; import notify from '../scripts/notify'; this.mixin('i'); @@ -264,11 +265,19 @@ this.reset = () => { passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-current-password%', currentPassword => { passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-new-password%', newPassword => { - this.api('i/change_password', { - current_password: currentPassword, - new_password: newPassword - }).then(() => { - notify('%i18n:desktop.tags.mk-password-setting.changed%'); + passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-new-password-again%', newPassword2 => { + if (newPassword !== newPassword2) { + dialog(null, '%i18n:desktop.tags.mk-password-setting.not-match%', [{ + text: 'OK' + }]); + return; + } + this.api('i/change_password', { + current_password: currentPassword, + new_password: newPassword + }).then(() => { + notify('%i18n:desktop.tags.mk-password-setting.changed%'); + }); }); }); });