Skip to content

Commit cf50ef8

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: Reword impersonnating event description
2 parents c324063 + 635618d commit cf50ef8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

security/impersonating_user.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,13 @@ not this is allowed. If your voter isn't called, see :ref:`declaring-the-voter-a
419419
Events
420420
------
421421

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

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

0 commit comments

Comments
 (0)