Two factor problems fixed after compose update

This commit is contained in:
2026-07-07 23:18:06 +02:00
parent 97963b34aa
commit dec038fc0d
143 changed files with 11760 additions and 10 deletions

View File

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

View File

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

View File

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