user, true, true); } else { notice(L10n::t('Invalid code, please retry.')); } } } public static function content() { if (!local_user()) { self::getApp()->internalRedirect(); } // Already authenticated with 2FA token if (Session::get('2fa')) { self::getApp()->internalRedirect(); } return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [ '$form_security_token' => self::getFormSecurityToken('twofactor_recovery'), '$title' => L10n::t('Two-factor recovery'), '$message' => L10n::t('
You can enter one of your one-time recovery codes in case you lost access to your mobile device.
'), '$recovery_message' => L10n::t('Don’t have your phone? Enter a two-factor recovery code', '2fa/recovery'), '$recovery_code' => ['recovery_code', L10n::t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'], '$recovery_label' => L10n::t('Submit recovery code and complete login'), ]); } }