two factor update
This commit is contained in:
parent
fd6924abb3
commit
573d373610
|
|
@ -151,8 +151,9 @@ namespace Alphaland\Users {
|
||||||
$localuser = $GLOBALS['user']->id;
|
$localuser = $GLOBALS['user']->id;
|
||||||
if (!TwoFactor::IsSession2FAUnlocked()) {
|
if (!TwoFactor::IsSession2FAUnlocked()) {
|
||||||
if (TwoFactor::Verify2FACode($localuser, $code)) {
|
if (TwoFactor::Verify2FACode($localuser, $code)) {
|
||||||
TwoFactor::Auth2FAUserSession();
|
if (TwoFactor::Auth2FAUserSession()) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
11
html/2fa.php
11
html/2fa.php
|
|
@ -6,14 +6,13 @@ if (TwoFactor::IsSession2FAUnlocked()){
|
||||||
redirect("/");
|
redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['submit_2fa']))
|
if(isset($_POST['submit_2fa'])) {
|
||||||
{
|
if (TwoFactor::AttemptSession2FAUnlock($_POST['2fa_code'])) {
|
||||||
TwoFactor::AttemptSession2FAUnlock($_POST['2fa_code']);
|
redirect("/");
|
||||||
redirect("/");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['logout']))
|
if(isset($_POST['logout'])) {
|
||||||
{
|
|
||||||
$user->logout();
|
$user->logout();
|
||||||
redirect("/");
|
redirect("/");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue