two factor update

This commit is contained in:
Austin 2021-11-28 05:19:21 -05:00
parent fd6924abb3
commit 573d373610
2 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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("/");
}