From 3de81877c6aaacfad993375bcf88b512958180ab Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 8 Mar 2023 13:15:33 +0000 Subject: more mfa cleanup --- Zotlabs/Module/Totp_check.php | 7 +++---- include/auth.php | 3 ++- view/tpl/totp.tpl | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Zotlabs/Module/Totp_check.php b/Zotlabs/Module/Totp_check.php index c0b38a513..8212d3716 100644 --- a/Zotlabs/Module/Totp_check.php +++ b/Zotlabs/Module/Totp_check.php @@ -62,8 +62,8 @@ class Totp_check extends Controller { public function get() { - if (!local_channel()) { - return; + if (!local_channel() || App::$module === 'totp_check') { + goaway(z_root()); } $account = App::get_account(); @@ -78,8 +78,7 @@ class Totp_check extends Controller { '$header' => t('Multifactor Verification'), '$id' => $id, '$desc' => t('Please enter the verification key from your authenticator app'), - '$submit' => t('Verify'), - '$static' => $static + '$submit' => t('Verify') ] ); } diff --git a/include/auth.php b/include/auth.php index 0ea7b3dba..5956b89e2 100644 --- a/include/auth.php +++ b/include/auth.php @@ -11,6 +11,7 @@ use Zotlabs\Lib\Libzot; use Zotlabs\Lib\AConfig; +use Zotlabs\Module\Totp_check; require_once('include/api_auth.php'); require_once('include/security.php'); @@ -267,7 +268,7 @@ if((isset($_SESSION)) && (x($_SESSION, 'authenticated')) && $multiFactor = AConfig::Get(App::$account['account_id'], 'system', 'mfa_enabled'); if ($multiFactor && empty($_SESSION['2FA_VERIFIED']) && App::$module !== 'totp_check') { - $o = new Zotlabs\Module\Totp_check; + $o = new Totp_check; echo $o->get(); killme(); } diff --git a/view/tpl/totp.tpl b/view/tpl/totp.tpl index d58f880cd..1f3b1cfc7 100644 --- a/view/tpl/totp.tpl +++ b/view/tpl/totp.tpl @@ -3,12 +3,13 @@ - + +
-- cgit v1.2.3