diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index 3219802edb7..b51a96d6fec 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -244,6 +244,67 @@ also adjust the query parameter name via the ``parameter`` setting: ; }; +Redirecting to a Specific Target Route +-------------------------------------- + +.. versionadded:: 6.2 + + The ``target_route`` configuration option was introduced in Symfony 6.2. + +.. note:: + + It works only in a stateful firewall. + +This feature allows you to control the redirection target route via ``target_route``. + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/security.yaml + security: + # ... + + firewalls: + main: + # ... + switch_user: { target_route: app_user_dashboard } + + .. code-block:: xml + + + + + + + + + + + + + + + .. code-block:: php + + // config/packages/security.php + use Symfony\Config\SecurityConfig; + + return static function (SecurityConfig $security) { + // ... + $security->firewall('main') + // ... + ->switchUser() + ->targetRoute('app_user_dashboard') + ; + }; + Limiting User Switching ----------------------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy