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 を書いていきます 主に notable な changes を書いていきます
unreleased
----------
* New: パスワードを変更する際に新しいパスワードを二度入力させる (#739)
2470 (2017/08/29) 2470 (2017/08/29)
----------------- -----------------
* New: トークンを再生成できるように (#497) * New: トークンを再生成できるように (#497)

View file

@ -212,6 +212,8 @@ desktop:
reset: "Change your password" reset: "Change your password"
enter-current-password: "Enter the current password" enter-current-password: "Enter the current password"
enter-new-password: "Enter the new 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" changed: "Password updated successfully"
mk-post-form: mk-post-form:

View file

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

View file

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

View file

@ -256,6 +256,7 @@
</style> </style>
<script> <script>
import passwordDialog from '../scripts/password-dialog'; import passwordDialog from '../scripts/password-dialog';
import dialog from '../scripts/dialog';
import notify from '../scripts/notify'; import notify from '../scripts/notify';
this.mixin('i'); this.mixin('i');
@ -264,11 +265,19 @@
this.reset = () => { this.reset = () => {
passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-current-password%', currentPassword => { passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-current-password%', currentPassword => {
passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-new-password%', newPassword => { passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-new-password%', newPassword => {
this.api('i/change_password', { passwordDialog('%i18n:desktop.tags.mk-password-setting.enter-new-password-again%', newPassword2 => {
current_password: currentPassword, if (newPassword !== newPassword2) {
new_password: newPassword dialog(null, '%i18n:desktop.tags.mk-password-setting.not-match%', [{
}).then(() => { text: 'OK'
notify('%i18n:desktop.tags.mk-password-setting.changed%'); }]);
return;
}
this.api('i/change_password', {
current_password: currentPassword,
new_password: newPassword
}).then(() => {
notify('%i18n:desktop.tags.mk-password-setting.changed%');
});
}); });
}); });
}); });