Skip to content

Commit 84f7ce3

Browse files
Minor rewording
...and aligning the template to https://symfony.com/doc/current/security.html#form-login
1 parent 0a93d6b commit 84f7ce3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

security/form_login.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,26 +142,26 @@ previously requested URL and always redirect to the default page:
142142
Control the Redirect Using Request Parameters
143143
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144144

145-
The URL to redirect after the login can be defined using the ``_target_path``
146-
parameter of GET and POST requests. Its value must be a relative or absolute
145+
The URL to redirect to after the login can be dynamically defined using the ``_target_path``
146+
parameter of the GET or POST request. Its value must be a relative or absolute
147147
URL, not a Symfony route name.
148148

149-
Defining the redirect URL via GET using a query string parameter:
149+
For GET, use a query string parameter:
150150

151151
.. code-block:: text
152152
153153
http://example.com/some/path?_target_path=/dashboard
154154
155-
Defining the redirect URL via POST using a hidden form field:
155+
For POST, use a hidden form field:
156156

157157
.. code-block:: html+twig
158158

159-
{# templates/security/login.html.twig #}
160-
<form action="{{ path('login') }}" method="post">
159+
{# templates/login/index.html.twig #}
160+
<form action="{{ path('app_login') }}" method="post">
161161
{# ... #}
162162

163-
<input type="hidden" name="_target_path" value="{{ path('account') }}"/>
164-
<input type="submit" name="login"/>
163+
<input type="hidden" name="_target_path" value="{{ path('account') }}">
164+
<input type="submit" name="login">
165165
</form>
166166

167167
Using the Referring URL

0 commit comments

Comments
 (0)