1
0
mirror of git://f0xx.org/ac/ac-deploy synced 2026-07-29 06:38:18 +03:00

fix(2fa): stop redirecting mobile approve GET to login page

QR scan must open one-tap approve directly; token in URL is sufficient.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-07-11 21:40:01 +02:00
parent ca28a7b97d
commit 624c9d3d7e

View File

@@ -324,13 +324,6 @@ if ($route === '/two-factor/approve' && $_SERVER['REQUEST_METHOD'] === 'POST') {
if ($route === '/two-factor/approve') {
$rawToken = trim($_GET['token'] ?? '');
$mobileUser = Auth::user();
if (!$mobileUser) {
// Not logged in on this device — send to login, come back here after
$returnUrl = Auth::authUrl('/two-factor/approve') . '?token=' . urlencode($rawToken);
header('Location: ' . Auth::authUrl('/login') . '?redirect=' . urlencode($returnUrl));
exit;
}
$approvalInfo = $rawToken !== '' ? AuthApproval::getForToken($rawToken) : null;
require __DIR__ . '/../views/two_factor_approve.php';
exit;