diff --git a/plugins/two-factor-auth/index.php b/plugins/two-factor-auth/index.php index a4b5a2be6..1582ba5b2 100644 --- a/plugins/two-factor-auth/index.php +++ b/plugins/two-factor-auth/index.php @@ -12,10 +12,6 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin CATEGORY = 'Login', DESCRIPTION = 'This plugin allows you to have TOTP 2FA'; - const - AccountTwoFactorAuthRequired = 120, - AccountTwoFactorAuthError = 121; - public function Init() : void { $this->UseLangs(true); @@ -44,11 +40,10 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin if ($aData && isset($aData['IsSet'], $aData['Enable']) && !empty($aData['Secret']) && $aData['IsSet'] && $aData['Enable']) { $sCode = \trim($this->jsonParam('totp_code', '')); if (empty($sCode)) { - $this->Logger()->Write("TFA: Required Code for {$oAccount->ParentEmailHelper()} account."); - throw new ClientException(static::AccountTwoFactorAuthRequired); + $this->Logger()->Write("TFA: Code required for {$oAccount->ParentEmailHelper()}"); + throw new ClientException(\RainLoop\Notifications::AuthError); } - $this->Logger()->Write("TFA: Verify Code for {$oAccount->ParentEmailHelper()} account."); $bUseBackupCode = false; if (6 < \strlen($sCode) && !empty($aData['BackupCodes'])) { $aBackupCodes = \explode(' ', \trim(\preg_replace('/[^\d]+/', ' ', $aData['BackupCodes']))); @@ -60,8 +55,10 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin if (!$bUseBackupCode && !$this->TwoFactorAuthProvider($oAccount)->VerifyCode($aData['Secret'], $sCode)) { $this->Manager()->Actions()->LoggerAuthHelper($oAccount); - throw new ClientException(static::AccountTwoFactorAuthError); + $this->Logger()->Write("TFA: Code failed for {$oAccount->ParentEmailHelper()}"); + throw new ClientException(\RainLoop\Notifications::AuthError); } + $this->Logger()->Write("TFA: Code verified for {$oAccount->ParentEmailHelper()}"); } } } diff --git a/plugins/two-factor-auth/js/TwoFactorAuthLogin.js b/plugins/two-factor-auth/js/TwoFactorAuthLogin.js index 0ccb577dd..c62522371 100644 --- a/plugins/two-factor-auth/js/TwoFactorAuthLogin.js +++ b/plugins/two-factor-auth/js/TwoFactorAuthLogin.js @@ -4,7 +4,7 @@ rl && addEventListener('rl-view-model', e => { if (e.detail && 'Login' === e.detail.viewModelTemplateID) { const container = e.detail.viewModelDom.querySelector('#plugin-Login-BottomControlGroup'), - placeholder = 'LOGIN/LABEL_VERIFICATION_CODE'; + placeholder = 'LOGIN/LABEL_TWO_FACTOR_CODE'; if (container) { container.prepend(Element.fromHTML('
' + '
' diff --git a/plugins/two-factor-auth/langs/de_DE.ini b/plugins/two-factor-auth/langs/de_DE.ini index 3658ae26a..51efb50df 100644 --- a/plugins/two-factor-auth/langs/de_DE.ini +++ b/plugins/two-factor-auth/langs/de_DE.ini @@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Sie können diese Einstellung nicht ohne v [POPUPS_TWO_FACTOR_TEST] TITLE_TEST_CODE = "Zwei-Faktor-Authentifizierung" LABEL_CODE = "Code" -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "Zwei-Faktor-Authentifizierung konfigurieren" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Zwei-Faktor-Authentifizierung erforderlich" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Fehler bei Zwei-Faktor-Authentifizierung" [LOGIN] -LABEL_VERIFICATION_CODE = "Verifizierungscode" -LABEL_DONT_ASK_VERIFICATION_CODE = "Für zwei Wochen nicht nach dem Code fragen" +LABEL_TWO_FACTOR_CODE = "Verifizierungscode" diff --git a/plugins/two-factor-auth/langs/en.ini b/plugins/two-factor-auth/langs/en.ini index 211f2fb25..1df2de2b2 100644 --- a/plugins/two-factor-auth/langs/en.ini +++ b/plugins/two-factor-auth/langs/en.ini @@ -19,11 +19,5 @@ 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" TWO_FACTOR_BACKUP_CODES_DESC = "If you can't receive codes via Google Authenticator (or other TOTP client), you can use backup codes to sign in. After you’ve used a backup code to sign in, it will become inactive.\n" TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "You can't change this setting before test." -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "Configure 2-Step verification" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Two factor verification required" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Two factor verification error" [LOGIN] -LABEL_VERIFICATION_CODE = "Verification Code" -LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks" +LABEL_TWO_FACTOR_CODE = "Verification Code" diff --git a/plugins/two-factor-auth/langs/es_ES.ini b/plugins/two-factor-auth/langs/es_ES.ini index 56f4c8894..bbe81bad9 100644 --- a/plugins/two-factor-auth/langs/es_ES.ini +++ b/plugins/two-factor-auth/langs/es_ES.ini @@ -19,11 +19,5 @@ 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." TWO_FACTOR_BACKUP_CODES_DESC = "Si usted no puede recibir los códigos a través de Google Authenticator, puede utilizar códigos de copia de seguridad para firmar pulg Después de que usted ha utilizado un código de copia de seguridad para iniciar sesión, se convertirá en inactiva." TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "You can't change this setting before test." -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "Configurar verificación de 2-Pasos" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Factor de verificación en dos pasos requerido" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Error de verificación en dos pasos" [LOGIN] -LABEL_VERIFICATION_CODE = "Código de verificación" -LABEL_DONT_ASK_VERIFICATION_CODE = "No solicitar el código de verificación durante 2 semanas" +LABEL_TWO_FACTOR_CODE = "Código de verificación" diff --git a/plugins/two-factor-auth/langs/fr_FR.ini b/plugins/two-factor-auth/langs/fr_FR.ini index 31bad129b..6fa94691b 100644 --- a/plugins/two-factor-auth/langs/fr_FR.ini +++ b/plugins/two-factor-auth/langs/fr_FR.ini @@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Vous ne pouvez pas modifier ce paramètre [POPUPS_TWO_FACTOR_TEST] TITLE_TEST_CODE = "Test d'authentification en deux étapes" LABEL_CODE = "Code" -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "Configurer l'authentification en deux étapes" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Double authentification requise" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Erreur lors de la double authentification" [LOGIN] -LABEL_VERIFICATION_CODE = "Code de vérification" -LABEL_DONT_ASK_VERIFICATION_CODE = "Ne plus demander le code pendant 2 semaines" +LABEL_TWO_FACTOR_CODE = "Code de vérification" diff --git a/plugins/two-factor-auth/langs/hu-HU.ini b/plugins/two-factor-auth/langs/hu-HU.ini index efe29a77c..655661a7c 100644 --- a/plugins/two-factor-auth/langs/hu-HU.ini +++ b/plugins/two-factor-auth/langs/hu-HU.ini @@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Tesztelés nélkül nem lehet megváltozta [POPUPS_TWO_FACTOR_TEST] TITLE_TEST_CODE = "2-lépéses hitelesítés teszt" LABEL_CODE = "Kód" -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "2 lépcsős hitelesítés beállítása" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Kétlépcsős azonosítás kötelező" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Kétlépcsős azonosítás hiba" [LOGIN] -LABEL_VERIFICATION_CODE = "Megerősítő kód" -LABEL_DONT_ASK_VERIFICATION_CODE = "Két hétig ne kérje a kódot" +LABEL_TWO_FACTOR_CODE = "Megerősítő kód" diff --git a/plugins/two-factor-auth/langs/nl_NL.ini b/plugins/two-factor-auth/langs/nl_NL.ini index bd720f11e..5cf4bada1 100644 --- a/plugins/two-factor-auth/langs/nl_NL.ini +++ b/plugins/two-factor-auth/langs/nl_NL.ini @@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "U kunt 2-stap verificatie niet activeren v [POPUPS_TWO_FACTOR_TEST] TITLE_TEST_CODE = "2-Stap verificatie test" LABEL_CODE = "Code" -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "Configureer 2-stap verificatie" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "2-Stap verificatie vereist" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "2-Stap verificatie fout" [LOGIN] -LABEL_VERIFICATION_CODE = "Verificatie Code" -LABEL_DONT_ASK_VERIFICATION_CODE = "Vraag 2 weken niet naar code" +LABEL_TWO_FACTOR_CODE = "Verificatie Code" diff --git a/plugins/two-factor-auth/langs/sv-SE.ini b/plugins/two-factor-auth/langs/sv-SE.ini index 9097b3af1..387d9f625 100644 --- a/plugins/two-factor-auth/langs/sv-SE.ini +++ b/plugins/two-factor-auth/langs/sv-SE.ini @@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "Du kan inte ändra denna inställning inna [POPUPS_TWO_FACTOR_TEST] TITLE_TEST_CODE = "Tvåstegsverifieringstest" LABEL_CODE = "Kod" -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "Konfigurera tvåstegsverifiering" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "Tvåstegsverifiering krävs" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "Tvåstegsverifieringsfel" [LOGIN] -LABEL_VERIFICATION_CODE = "Verifikationskod" -LABEL_DONT_ASK_VERIFICATION_CODE = "Fråga inte efter koden på 2 veckor" +LABEL_TWO_FACTOR_CODE = "Verifikationskod" diff --git a/plugins/two-factor-auth/langs/zh_CN.ini b/plugins/two-factor-auth/langs/zh_CN.ini index 0421e208a..c4f923852 100644 --- a/plugins/two-factor-auth/langs/zh_CN.ini +++ b/plugins/two-factor-auth/langs/zh_CN.ini @@ -19,11 +19,5 @@ TWO_FACTOR_SECRET_TEST_BEFORE_DESC = "完成测试前你无法更改此设置。 [POPUPS_TWO_FACTOR_TEST] TITLE_TEST_CODE = "两步验证测试" LABEL_CODE = "代码" -[SETTINGS_SECURITY] -LABEL_CONFIGURE_TWO_FACTOR = "配置两步验证" -[NOTIFICATIONS] -ACCOUNT_TWO_FACTOR_AUTH_REQUIRED = "需要进行两步验证" -ACCOUNT_TWO_FACTOR_AUTH_ERROR = "两步验证错误" [LOGIN] -LABEL_VERIFICATION_CODE = "验证码" -LABEL_DONT_ASK_VERIFICATION_CODE = "在两周内不再询问验证码" +LABEL_TWO_FACTOR_CODE = "验证码"