Skip to content

Commit d47612c

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: Reword impersonnating event description
2 parents 06e8e69 + 979eee7 commit d47612c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

security/impersonating_user.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,13 @@ not this is allowed. If your voter isn't called, see :ref:`declaring-the-voter-a
415415
Events
416416
------
417417

418-
The firewall dispatches the ``security.switch_user`` event right after the impersonation
419-
is completed. The :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent` is
420-
passed to the listener, and you can use this to get the user that you are now impersonating.
418+
the ``security.switch_user`` event is dispatched just before the impersonation
419+
is fully completed. Your :doc:`listener or subscriber </event_dispatcher>` will
420+
receive a :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent`,
421+
which you can use to get the user that you are now impersonating.
422+
423+
This event is also dispatched just before impersonation is fully exited. You can
424+
use it to get the original impersonator user.
421425

422426
The :ref:`locale-sticky-session` section does not update the locale when you
423427
impersonate a user. If you *do* want to be sure to update the locale when you

0 commit comments

Comments
 (0)