Two factor problems fixed after compose update
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}'/api/classes/API_mfa.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_mfa.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/../vendor/autoload.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/login/php/authFunctions.php";
|
||||
|
||||
|
||||
use api\classes\API_mfa;
|
||||
use RobThree\Auth\TwoFactorAuth;
|
||||
use RobThree\Auth\Providers\Qr\EndroidQrCodeWithLogoProvider;
|
||||
use RobThree\Auth\Providers\Qr\EndroidQrCodeProvider;
|
||||
|
||||
$API_mfa = new API_mfa();
|
||||
|
||||
@@ -24,7 +24,7 @@ if ($API_mfa->request_method === 'POST') {
|
||||
$this->apiOutput(400, ['error' => 'secret not found.']);
|
||||
}
|
||||
|
||||
$tfa = new TwoFactorAuth(new EndroidQrCodeWithLogoProvider());
|
||||
$tfa = new TwoFactorAuth(new EndroidQrCodeProvider());
|
||||
|
||||
$API_mfa->postedData['user_uuid'] = $_SESSION['user']['user_uuid'];
|
||||
$API_mfa->postedData['user_two_factor_secret'] = $_SESSION['mfasetup']['secret'];
|
||||
|
||||
@@ -217,9 +217,9 @@ if ($user_data) { ?>
|
||||
|
||||
<div id="mfa-disabled-row" class="row <?= ($_SESSION['user']['user_two_factor_enabled'] ? 'd-none' : '') ?>">
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-danger delete-btn" disabled>
|
||||
<i class="fa-solid fa-lock"></i> <?= __('reset_mfa') ?>
|
||||
</button>
|
||||
<a href="/login/mfaSetup.php" class="btn btn-success">
|
||||
<i class="fa-solid fa-lock"></i> <?= __('set_mfa') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ session_start();
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/../vendor/autoload.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/login/php/authFunctions.php";
|
||||
|
||||
use RobThree\Auth\Providers\Qr\EndroidQrCodeWithLogoProvider;
|
||||
use RobThree\Auth\Providers\Qr\EndroidQrCodeProvider;
|
||||
use RobThree\Auth\TwoFactorAuth;
|
||||
|
||||
if (!isset($_POST['verification-1']) && !isset($_SESSION['mfa']['user_secret']) && !isset($_SESSION['mfa']['user_uuid'])) {
|
||||
@@ -20,7 +20,7 @@ if (checkLoginAttempts() > 3) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$tfa = new TwoFactorAuth(new EndroidQrCodeWithLogoProvider());
|
||||
$tfa = new TwoFactorAuth(new EndroidQrCodeProvider());
|
||||
|
||||
$secret = $_SESSION['mfa']['user_secret'];
|
||||
$postedCode = linkVerificationPosts();
|
||||
|
||||
Reference in New Issue
Block a user