Commit a410ac7
committed
feature symfony#61486 [Security] Ignore target route when exiting impersonation (MatTheCat)
This PR was merged into the 6.4 branch.
Discussion
----------
[Security] Ignore target route when exiting impersonation
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix symfony#53873
| License | MIT
[The user impersonation documentation](https://symfony.com/doc/current/security/impersonating_user.html#redirecting-to-a-specific-target-route) just mentions
> control the redirection target route via `target_route`
Now, given that Twig’s `impersonation_exit_path` and `impersonation_exit_url` have an `exitTo` parameter but not `impersonation_path` nor `impersonation_url`, it looks like `target_route` should only be used when **starting** an impersonation. However it is currently also used when exiting, which means that if you configured one, an `exitTo` argument wouldn’t have any effect.
Based on this assumption, this PR ignores `target_route` when exiting impersonation.
Since `exitTo` will now work with `target_route` this PR technically breaks BC, but since this behavior was broken I’m not sure it needs to be considered.
Commits
-------
5c4618c [Security] Ignore target route when exiting impersonationFile tree
2 files changed
+16
-1
lines changed- src/Symfony/Component/Security/Http
- Firewall
- Tests/Firewall
2 files changed
+16
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
108 | 123 | | |
109 | 124 | | |
110 | 125 | | |
| |||
0 commit comments