1
0
mirror of git://f0xx.org/ac/ac-platform-php synced 2026-07-29 06:17:54 +03:00

fix(session): honor X-Forwarded-Proto; widen auth route matching

Secure session cookies behind TLS-terminating FE. resolve_console_route
recognizes /two-factor/approve and /api/two-factor/poll.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-07-05 19:12:53 +02:00
parent 0ebb12b52d
commit e482d56ef5
2 changed files with 4 additions and 2 deletions

View File

@@ -119,7 +119,7 @@ function resolve_console_route(string $uri): string {
if ($projectRoot !== '' && str_starts_with($uri, $projectRoot)) {
$suffix = substr($uri, strlen($projectRoot)) ?: '/';
$candidate = rtrim(strtok($suffix, '?') ?: '/', '/') ?: '/';
if (preg_match('#^/(login|logout|register|two-factor|verify-email)(?:/|$)#', $candidate)) {
if (preg_match('#^/(login|logout|register|verify-email|two-factor(?:/approve)?|api/two-factor(?:/poll)?)(/|$)#', $candidate)) {
return $candidate;
}
}