Skip to content

Keep the proxy prefix when going back from "Reset two-factor" and "Turn off" - #1

Merged
calmfoxpl merged 2 commits into
mainfrom
fix/forwarded-prefix
Oct 10, 2026
Merged

calmfoxpl merged 2 commits into
mainfrom
fix/forwarded-prefix

Conversation

@calmfoxpl

Copy link
Copy Markdown
Owner

What

Behind a reverse proxy that mounts the shop under a prefix (X-Forwarded-Prefix, e.g. example.com/store), Reset two-factor and Turn off (grid and edit page) came back to /admin/users/... without the prefix, i.e. to the root of the domain, where another site may live.

The forms used app.request.requestUri: the bare request path, which Symfony never prefixes (only getBaseUrl()/getUri() and the router know about the trusted prefix).

How

  • The forms carry the page's full address (app.request.uri).
  • ManageAction accepts a _redirect that is a local path or an absolute URL of this site; any other host still falls back to the administrators list (covered by a new functional test).
  • The test application trusts the test client as a proxy, so the functional test can mount it under /store and check the addresses the pages render and the redirect after the POST.

Checks

ecs, phpstan, lint:container, lint:twig, lint:yaml, phpunit (82 tests) pass locally.

🤖 Generated with Claude Code

calmfoxpl and others added 2 commits October 10, 2026 18:29
…rn off"

Behind a reverse proxy that mounts the shop under a prefix (X-Forwarded-Prefix,
e.g. example.com/store), the forms on the grid and the edit page used
app.request.requestUri: the bare request path, which Symfony never prefixes.
After the operation the administrator landed at the root of the domain, where
another site may live.

The forms now carry the page's full address (app.request.uri) and the controller
accepts it when it points at this site. The test application trusts the test
client as a proxy, so a functional test can mount it under a prefix.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@calmfoxpl
calmfoxpl merged commit 8a8698b into main Oct 10, 2026
5 checks passed
@calmfoxpl
calmfoxpl deleted the fix/forwarded-prefix branch October 10, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant