mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Cleanup two-factor-auth extension
This commit is contained in:
parent
62b6a1513c
commit
e4b70c2af1
11 changed files with 6 additions and 54 deletions
|
|
@ -33,8 +33,6 @@ class TwoFactorAuthSettings
|
|||
{
|
||||
|
||||
constructor() {
|
||||
this.lock = ko.observable(false);
|
||||
|
||||
this.processing = ko.observable(false);
|
||||
this.clearing = ko.observable(false);
|
||||
this.secreting = ko.observable(false);
|
||||
|
|
@ -90,10 +88,6 @@ class TwoFactorAuthSettings
|
|||
this.onShowSecretResult = this.onShowSecretResult.bind(this);
|
||||
}
|
||||
|
||||
configureTwoFactor() {
|
||||
// showScreenPopup(require('View/Popup/TwoFactorConfiguration'));
|
||||
}
|
||||
|
||||
showSecret() {
|
||||
this.secreting(true);
|
||||
rl.pluginRemoteRequest(this.onShowSecretResult, 'ShowTwoFactorSecret');
|
||||
|
|
@ -110,10 +104,6 @@ class TwoFactorAuthSettings
|
|||
rl.pluginRemoteRequest(this.onResult, 'CreateTwoFactorSecret');
|
||||
}
|
||||
|
||||
logout() {
|
||||
rl.app.logout();
|
||||
}
|
||||
|
||||
testTwoFactor() {
|
||||
TwoFactorAuthTestPopupView.showModal([this.twoFactorTested]);
|
||||
}
|
||||
|
|
@ -127,17 +117,10 @@ class TwoFactorAuthSettings
|
|||
rl.pluginRemoteRequest(this.onResult, 'ClearTwoFactorInfo');
|
||||
}
|
||||
|
||||
onShow(bLock) {
|
||||
this.lock(!!bLock);
|
||||
onShow() {
|
||||
this.hideSecret('');
|
||||
}
|
||||
|
||||
onHide() {
|
||||
if (this.lock()) {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
getQr() {
|
||||
return 'otpauth://totp/' + encodeURIComponent(this.viewUser())
|
||||
+ '?secret=' + encodeURIComponent(this.viewSecret())
|
||||
|
|
@ -191,12 +174,9 @@ class TwoFactorAuthTestPopupView extends rl.pluginPopupView {
|
|||
this.addObservables({
|
||||
code: '',
|
||||
codeStatus: null,
|
||||
|
||||
testing: false
|
||||
});
|
||||
|
||||
this.koTestedTrigger = null;
|
||||
|
||||
ko.decorateCommands(this, {
|
||||
testCodeCommand: self => self.code() && !self.testing()
|
||||
});
|
||||
|
|
@ -207,25 +187,15 @@ class TwoFactorAuthTestPopupView extends rl.pluginPopupView {
|
|||
Remote.verifyCode(iError => {
|
||||
this.testing(false);
|
||||
this.codeStatus(!iError);
|
||||
|
||||
if (this.koTestedTrigger && this.codeStatus()) {
|
||||
this.koTestedTrigger(true);
|
||||
}
|
||||
this.twoFactorTested(!iError);
|
||||
}, this.code());
|
||||
}
|
||||
|
||||
clearPopup() {
|
||||
onShow(twoFactorTested) {
|
||||
this.code('');
|
||||
this.codeStatus(null);
|
||||
this.testing(false);
|
||||
|
||||
this.koTestedTrigger = null;
|
||||
}
|
||||
|
||||
onShow(koTestedTrigger) {
|
||||
this.clearPopup();
|
||||
|
||||
this.koTestedTrigger = koTestedTrigger;
|
||||
this.twoFactorTested = twoFactorTested;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ BUTTON_ACTIVATE = "Aktivieren"
|
|||
LINK_TEST = "test"
|
||||
BUTTON_SHOW_SECRET = "Geheimnis einblenden"
|
||||
BUTTON_HIDE_SECRET = "Geheminis ausblenden"
|
||||
TWO_FACTOR_REQUIRE_DESC = "Ihr Benutzerkonto erfordert die Einrichtung der Zwei-Faktor-Authentifizierung."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Konfiguriert"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Nicht konfiguriert"
|
||||
TWO_FACTOR_SECRET_DESC = "Importieren Sie diese Information in Ihre Google-Authenticator-Anwendung (oder andere TOTP-Anwendung), indem Sie den unten bereitgestellten QR-Code verwenden oder den Code manuell eingeben."
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ BUTTON_ACTIVATE = "Activate"
|
|||
LINK_TEST = "test"
|
||||
BUTTON_SHOW_SECRET = "Show Secret"
|
||||
BUTTON_HIDE_SECRET = "Hide Secret"
|
||||
TWO_FACTOR_REQUIRE_DESC = "Your account requires 2-Step verification configuration."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Configured"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Not configured"
|
||||
TWO_FACTOR_SECRET_DESC = "Import this info into your Google Authenticator client (or other TOTP client) using the provided QR code below or by entering the code manually.\n"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ BUTTON_ACTIVATE = "Activate"
|
|||
LINK_TEST = "probar"
|
||||
BUTTON_SHOW_SECRET = "Mostrar clave secreta"
|
||||
BUTTON_HIDE_SECRET = "Ocultar clave secreta"
|
||||
TWO_FACTOR_REQUIRE_DESC = "Se requiere que configure la verificación de 2-pasos."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Configurado"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "No configurado"
|
||||
TWO_FACTOR_SECRET_DESC = "Importar esta información en su cliente Google Authenticator (u otro cliente TOTP) utilizando el código QR se indica debajo o introduciendo el código manualmente."
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ BUTTON_ACTIVATE = "Activer"
|
|||
LINK_TEST = "test"
|
||||
BUTTON_SHOW_SECRET = "Montrer la clé secrète"
|
||||
BUTTON_HIDE_SECRET = "Masquer la clé secrète"
|
||||
TWO_FACTOR_REQUIRE_DESC = "Votre compte requiert la configuration d'une vérification en deux étapes."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Configuré"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Non configuré"
|
||||
TWO_FACTOR_SECRET_DESC = "Importez ces informations dans votre client Google Authenticator (ou un autre client TOTP) en utilisant le code QR fourni ci-dessous ou en entrant les valeurs manuellement."
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ BUTTON_ACTIVATE = "Aktivál"
|
|||
LINK_TEST = "teszt"
|
||||
BUTTON_SHOW_SECRET = "Titok megjelenítése"
|
||||
BUTTON_HIDE_SECRET = "Titok elrejtése"
|
||||
TWO_FACTOR_REQUIRE_DESC = "A fiókhoz 2 lépcsős hitelesítés szükséges."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Beállítva"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Nincs beállítva"
|
||||
TWO_FACTOR_SECRET_DESC = "Importáld ezt az infót a Google Authenticator kliensedbe (vagy más TOTP kliensbe) az alábbi QR kód használatával vagy a kód manuális megadatásával.\n"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ BUTTON_ACTIVATE = "Attiva"
|
|||
LINK_TEST = "test"
|
||||
BUTTON_SHOW_SECRET = "Mostra la chiave segreta"
|
||||
BUTTON_HIDE_SECRET = "Nascondi la chiave segreta"
|
||||
TWO_FACTOR_REQUIRE_DESC = "Il tuo account richiede la configurazione della verifica a 2 fattori."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Configurato"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Non configurato"
|
||||
TWO_FACTOR_SECRET_DESC = "Importa queste informazioni nella tua app Google Authenticator (o un altro programma per l'autenticazione a due fattori) utilizzando il codice QR fornito qui sotto o inserendo il codice manualmente.\n"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ BUTTON_ACTIVATE = "Activate"
|
|||
LINK_TEST = "test"
|
||||
BUTTON_SHOW_SECRET = "Bekijk geheime sleutel"
|
||||
BUTTON_HIDE_SECRET = "Verberg geheime sleutel"
|
||||
TWO_FACTOR_REQUIRE_DESC = "Uw account vereist 2-Stap verificatie configuratie."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Geconfigureerd"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Niet geconfigureerd"
|
||||
TWO_FACTOR_SECRET_DESC = "Importeer deze informatie in uw Google Authenticator-client (of andere TOTP-client) door gebruik te maken van de QR code hier beneden of door de code handmatig in te voeren."
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ BUTTON_ACTIVATE = "Aktivera"
|
|||
LINK_TEST = "test"
|
||||
BUTTON_SHOW_SECRET = "Visa hemlig kod"
|
||||
BUTTON_HIDE_SECRET = "Göm hemlig kod"
|
||||
TWO_FACTOR_REQUIRE_DESC = "Ditt konto kräver tvåstegsverifiering."
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "Konfigurerad"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "Inte konfigurarad"
|
||||
TWO_FACTOR_SECRET_DESC = "Importera denna information till din Google Authenticator klient (eller annan TOTP klient) med denna QR kod eller manuellt med koden här nedan."
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ BUTTON_ACTIVATE = "启用"
|
|||
LINK_TEST = "测试"
|
||||
BUTTON_SHOW_SECRET = "显示密钥"
|
||||
BUTTON_HIDE_SECRET = "隐藏密钥"
|
||||
TWO_FACTOR_REQUIRE_DESC = "您的账户需要设置两步验证。"
|
||||
TWO_FACTOR_SECRET_CONFIGURED_DESC = "已设置"
|
||||
TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC = "未设置"
|
||||
TWO_FACTOR_SECRET_DESC = "将下面的信息导入 Google Authenticator (或其他 TOTP 客户端)。 扫描下面的二维码或手动输入密钥。\n"
|
||||
|
|
|
|||
|
|
@ -24,12 +24,7 @@
|
|||
<span data-i18n="POPUPS_TWO_FACTOR_CFG/LABEL_TWO_FACTOR_USER"></span>
|
||||
</label>
|
||||
<div class="controls" style="padding-top: 5px;">
|
||||
<strong><span data-bind="text: viewUser"></span></strong>
|
||||
<div style="padding-top: 15px;" data-bind="visible: lock">
|
||||
<blockquote>
|
||||
<p class="muted width100-on-mobile" style="width: 550px" data-i18n="POPUPS_TWO_FACTOR_CFG/TWO_FACTOR_REQUIRE_DESC"></p>
|
||||
</blockquote>
|
||||
</div>
|
||||
<strong data-bind="text: viewUser"></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: '' === viewSecret() && twoFactorStatus() && !clearing()">
|
||||
|
|
@ -69,10 +64,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<a class="btn" data-bind="visible: lock, click: logout">
|
||||
<i class="fontastic">⏻</i>
|
||||
<span data-i18n="GLOBAL/LOGOUT"></span>
|
||||
</a>
|
||||
<a class="btn btn-danger" data-bind="click: clearTwoFactor, visible: twoFactorStatus">
|
||||
<i class="fontastic" data-bind="css: {'icon-spinner': clearing()}">✖</i>
|
||||
<span data-i18n="GLOBAL/CLEAR"></span>
|
||||
|
|
@ -82,7 +73,7 @@
|
|||
<span data-i18n="POPUPS_TWO_FACTOR_CFG/BUTTON_ACTIVATE"></span>
|
||||
</a>
|
||||
<!--
|
||||
<a class="btn" data-bind="command: closeCommand, visible: viewEnable() || !lock()">
|
||||
<a class="btn" data-bind="command: closeCommand, visible: viewEnable()">
|
||||
<i class="icon-ok" ></i>
|
||||
<span data-i18n="GLOBAL/DONE"></span>
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue