This commit is contained in:
syuilo 2017-08-29 02:46:28 +09:00
parent 79ab756040
commit 15d08564c8
5 changed files with 25 additions and 5 deletions

View File

@ -2,6 +2,10 @@ ChangeLog
=========
主に notable な changes を書いていきます
unreleased
----------
* New: パスワードを変更する際に新しいパスワードを二度入力させる (#739)
2470 (2017/08/29)
-----------------
* New: トークンを再生成できるように (#497)

View File

@ -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:

View File

@ -212,6 +212,8 @@ desktop:
reset: "パスワードを変更する"
enter-current-password: "現在のパスワードを入力してください"
enter-new-password: "新しいパスワードを入力してください"
enter-new-password-again: "もう一度新しいパスワードを入力してください"
not-match: "新しいパスワードが一致しません"
changed: "パスワードを変更しました"
mk-post-form:

View File

@ -44,6 +44,9 @@
// color #43A4EC
font-weight bold
&:empty
display none
> i
margin-right 0.5em

View File

@ -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%');
});
});
});
});