Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2fcba90

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Security] Add form_only option
2 parents 46647a9 + ef5d786 commit 2fcba90

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

reference/configuration/security.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,21 @@ failure_path
332332
This is the route or path that the user is redirected to after a failed login attempt.
333333
It can be a relative/absolute URL or a Symfony route name.
334334

335+
form_only
336+
.........
337+
338+
**type**: ``boolean`` **default**: ``false``
339+
340+
Set this option to ``true`` to require that the login data is sent using a form
341+
(it checks that the request content-type is ``application/x-www-form-urlencoded``).
342+
This is useful for example to prevent the :ref:`form login authenticator <security-form-login>`
343+
from responding to requests that should be handled by the
344+
:ref:`JSON login authenticator <security-json-login>`.
345+
346+
.. versionadded:: 5.4
347+
348+
The ``form_only`` option was introduced in Symfony 5.4.
349+
335350
use_forward
336351
...........
337352

security.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,8 @@ After this, you have protected your login form against CSRF attacks.
919919
the token ID by setting ``csrf_token_id`` in your configuration. See
920920
:ref:`reference-security-firewall-form-login` for more details.
921921

922+
.. _security-json-login:
923+
922924
JSON Login
923925
~~~~~~~~~~
924926

0 commit comments

Comments
 (0)