You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#58754 [Security] Store original token in token storage when implicitly exiting impersonation (wouterj)
This PR was merged into the 5.4 branch.
Discussion
----------
[Security] Store original token in token storage when implicitly exiting impersonation
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
If you impersonate user A and then start impersonation for user B, Symfony explicitly exits the first impersonation before starting the second one. However, we did not update the token in the token storage at this moment.
This creates issues when using a custom voter [like the one documented](https://symfony.com/doc/current/security/impersonating_user.html#limiting-user-switching), as this uses `Security::isGranted()`, which relies on the token in the token storage. So instead of checking if the original user can impersonate, it will check if user A can impersonate.
Commits
-------
a496ecf [Security] Store original token in token storage when implicitly exiting impersonation
0 commit comments