From d0cfe112e11c52acaeebb42c3229a37af23c846a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 10 Dec 2017 02:45:32 +0900 Subject: #973 --- src/web/app/desktop/tags/settings.tag | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/web') diff --git a/src/web/app/desktop/tags/settings.tag b/src/web/app/desktop/tags/settings.tag index 9f71da6876..3fa1f50fce 100644 --- a/src/web/app/desktop/tags/settings.tag +++ b/src/web/app/desktop/tags/settings.tag @@ -266,7 +266,11 @@

%i18n:desktop.tags.mk-2fa-setting.intro%%i18n:desktop.tags.mk-2fa-setting.detail%

%fa:exclamation-triangle%%i18n:desktop.tags.mk-2fa-setting.caution%

-

+

+ +

%i18n:desktop.tags.mk-2fa-setting.already-registered%

+ +
  1. %i18n:desktop.tags.mk-2fa-setting.authenticator% %i18n:desktop.tags.mk-2fa-setting.howtoinstall%
  2. @@ -288,6 +292,7 @@ import passwordDialog from '../scripts/password-dialog'; import notify from '../scripts/notify'; + this.mixin('i'); this.mixin('api'); this.register = () => { @@ -302,11 +307,25 @@ }); }; + this.unregister = () => { + passwordDialog('%i18n:desktop.tags.mk-2fa-setting.enter-password%', password => { + this.api('i/2fa/unregister', { + password: password + }).then(data => { + notify('%i18n:desktop.tags.mk-2fa-setting.unregistered%'); + this.I.two_factor_enabled = false; + this.I.update(); + }); + }); + }; + this.submit = () => { this.api('i/2fa/done', { token: this.refs.token.value }).then(() => { notify('%i18n:desktop.tags.mk-2fa-setting.success%'); + this.I.two_factor_enabled = true; + this.I.update(); }).catch(() => { notify('%i18n:desktop.tags.mk-2fa-setting.failed%'); }); -- cgit v1.2.3-freya