Skip to content

Commit 6958aa9

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: [Security] Minor rewording Minor
2 parents aeccac8 + 96b72e7 commit 6958aa9

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

reference/configuration/security.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ username_parameter
284284

285285
**type**: ``string`` **default**: ``_username``
286286

287-
This is the field name that you should give to the username field of your
287+
This is the name of the username field of your
288288
login form. When you submit the form to ``check_path``, the security system
289289
will look for a POST parameter with this name.
290290

@@ -293,7 +293,7 @@ password_parameter
293293

294294
**type**: ``string`` **default**: ``_password``
295295

296-
This is the field name that you should give to the password field of your
296+
This is the name of the password field of your
297297
login form. When you submit the form to ``check_path``, the security system
298298
will look for a POST parameter with this name.
299299

@@ -304,7 +304,7 @@ post_only
304304

305305
By default, you must submit your login form to the ``check_path`` URL as
306306
a POST request. By setting this option to ``false``, you can send a GET
307-
request to the ``check_path`` URL.
307+
request too.
308308

309309
**Options Related to Redirecting after Login**
310310

security/form_login.rst

Lines changed: 13 additions & 13 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
@@ -304,8 +304,8 @@ This option can also be set via the ``_failure_path`` request parameter:
304304
<form action="{{ path('login') }}" method="post">
305305
{# ... #}
306306

307-
<input type="hidden" name="_failure_path" value="{{ path('forgot_password') }}"/>
308-
<input type="submit" name="login"/>
307+
<input type="hidden" name="_failure_path" value="{{ path('forgot_password') }}">
308+
<input type="submit" name="login">
309309
</form>
310310

311311
Customizing the Target and Failure Request Parameters
@@ -383,7 +383,7 @@ are now fully customized:
383383
<form action="{{ path('login') }}" method="post">
384384
{# ... #}
385385

386-
<input type="hidden" name="go_to" value="{{ path('dashboard') }}"/>
387-
<input type="hidden" name="back_to" value="{{ path('forgot_password') }}"/>
388-
<input type="submit" name="login"/>
386+
<input type="hidden" name="go_to" value="{{ path('dashboard') }}">
387+
<input type="hidden" name="back_to" value="{{ path('forgot_password') }}">
388+
<input type="submit" name="login">
389389
</form>

0 commit comments

Comments
 (0)