mirror of
git://f0xx.org/ac/ac-deploy
synced 2026-07-29 04:19:00 +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:
@@ -324,13 +324,6 @@ if ($route === '/two-factor/approve' && $_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
|
|
||||||
if ($route === '/two-factor/approve') {
|
if ($route === '/two-factor/approve') {
|
||||||
$rawToken = trim($_GET['token'] ?? '');
|
$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;
|
$approvalInfo = $rawToken !== '' ? AuthApproval::getForToken($rawToken) : null;
|
||||||
require __DIR__ . '/../views/two_factor_approve.php';
|
require __DIR__ . '/../views/two_factor_approve.php';
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Reference in New Issue
Block a user