From 573d373610220c134691841c3289543f58f3c672 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 28 Nov 2021 05:19:21 -0500 Subject: [PATCH] two factor update --- globals/Dependencies/Users/TwoFactor.php | 5 +++-- html/2fa.php | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/globals/Dependencies/Users/TwoFactor.php b/globals/Dependencies/Users/TwoFactor.php index 8c0e6e5..28ab379 100644 --- a/globals/Dependencies/Users/TwoFactor.php +++ b/globals/Dependencies/Users/TwoFactor.php @@ -151,8 +151,9 @@ namespace Alphaland\Users { $localuser = $GLOBALS['user']->id; if (!TwoFactor::IsSession2FAUnlocked()) { if (TwoFactor::Verify2FACode($localuser, $code)) { - TwoFactor::Auth2FAUserSession(); - return true; + if (TwoFactor::Auth2FAUserSession()) { + return true; + } } } return false; diff --git a/html/2fa.php b/html/2fa.php index aae37de..09dee6b 100644 --- a/html/2fa.php +++ b/html/2fa.php @@ -6,14 +6,13 @@ if (TwoFactor::IsSession2FAUnlocked()){ redirect("/"); } -if(isset($_POST['submit_2fa'])) -{ - TwoFactor::AttemptSession2FAUnlock($_POST['2fa_code']); - redirect("/"); +if(isset($_POST['submit_2fa'])) { + if (TwoFactor::AttemptSession2FAUnlock($_POST['2fa_code'])) { + redirect("/"); + } } -if(isset($_POST['logout'])) -{ +if(isset($_POST['logout'])) { $user->logout(); redirect("/"); }