Skip to content

Commit 3c5770e

Browse files
committed
minor #11450 [Security] Dispatch an event when "logout user on change" steps in (Simperfit)
This PR was merged into the master branch. Discussion ---------- [Security] Dispatch an event when "logout user on change" steps in <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> This documents the new event implemented in symfony/symfony#31138 Commits ------- b5e6038 [Security] Dispatch an event when "logout user on change" steps in
2 parents 9864f0f + b5e6038 commit 3c5770e

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

components/security/authentication.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,15 @@ Authentication Events
276276

277277
The security component provides 4 related authentication events:
278278

279-
=============================== ================================================ ==============================================================================
280-
Name Event Constant Argument Passed to the Listener
281-
=============================== ================================================ ==============================================================================
282-
security.authentication.success ``AuthenticationEvents::AUTHENTICATION_SUCCESS`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationEvent`
283-
security.authentication.failure ``AuthenticationEvents::AUTHENTICATION_FAILURE`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationFailureEvent`
284-
security.interactive_login ``SecurityEvents::INTERACTIVE_LOGIN`` :class:`Symfony\\Component\\Security\\Http\\Event\\InteractiveLoginEvent`
285-
security.switch_user ``SecurityEvents::SWITCH_USER`` :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent`
286-
=============================== ================================================ ==============================================================================
279+
=============================== ================================================================= ==============================================================================
280+
Name Event Constant Argument Passed to the Listener
281+
=============================== ================================================================= ==============================================================================
282+
security.authentication.success ``AuthenticationEvents::AUTHENTICATION_SUCCESS`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationEvent`
283+
security.authentication.failure ``AuthenticationEvents::AUTHENTICATION_FAILURE`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationFailureEvent`
284+
security.interactive_login ``SecurityEvents::INTERACTIVE_LOGIN`` :class:`Symfony\\Component\\Security\\Http\\Event\\InteractiveLoginEvent`
285+
security.switch_user ``SecurityEvents::SWITCH_USER`` :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent`
286+
security.logout_on_change ``Symfony\Component\Security\Http\Event\DeauthenticatedEvent`` :class:`Symfony\Component\Security\Http\EventDeauthenticatedEvent`
287+
=============================== ================================================================= ==============================================================================
287288

288289
Authentication Success and Failure Events
289290
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -314,6 +315,13 @@ order to give your user a welcome flash message every time they log in.
314315
The ``security.switch_user`` event is triggered every time you activate
315316
the ``switch_user`` firewall listener.
316317

318+
The ``Symfony\Component\Security\Http\Event\DeauthenticatedEvent`` event is triggered when a token has been deauthenticated
319+
because of a user change, it can help you doing some clean-up task when a logout has been triggered.
320+
321+
.. versionadded:: 4.3
322+
323+
The ``Symfony\Component\Security\Http\Event\DeauthenticatedEvent`` event was introduced in Symfony 4.3.
324+
317325
.. seealso::
318326

319327
For more information on switching users, see

0 commit comments

Comments
 (0)