diff --git a/security.rst b/security.rst index fd774597406..492fcd08d04 100644 --- a/security.rst +++ b/security.rst @@ -768,13 +768,13 @@ Finally, create or update the template:
- + - + {# If you want to control the URL the user is redirected to on success - #} + #}
diff --git a/security/form_login.rst b/security/form_login.rst index 5bae5c6e62b..85d8a150a8f 100644 --- a/security/form_login.rst +++ b/security/form_login.rst @@ -142,26 +142,26 @@ previously requested URL and always redirect to the default page: Control the Redirect Using Request Parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The URL to redirect after the login can be defined using the ``_target_path`` -parameter of GET and POST requests. Its value must be a relative or absolute +The URL to redirect to after the login can be dynamically defined using the ``_target_path`` +parameter of the GET or POST request. Its value must be a relative or absolute URL, not a Symfony route name. -Defining the redirect URL via GET using a query string parameter: +For GET, use a query string parameter: .. code-block:: text http://example.com/some/path?_target_path=/dashboard -Defining the redirect URL via POST using a hidden form field: +For POST, use a hidden form field: .. code-block:: html+twig - {# templates/security/login.html.twig #} -
+ {# templates/login/index.html.twig #} + {# ... #} - - + +
Using the Referring URL @@ -304,8 +304,8 @@ This option can also be set via the ``_failure_path`` request parameter:
{# ... #} - - + +
Customizing the Target and Failure Request Parameters @@ -383,7 +383,7 @@ are now fully customized:
{# ... #} - - - + + +