two factor update
This commit is contained in:
parent
fd6924abb3
commit
573d373610
|
|
@ -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;
|
||||
|
|
|
|||
11
html/2fa.php
11
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("/");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue