Skip to content

Commit 34ddba7

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: [Security] Add form_only option
2 parents 862ee9b + 777a103 commit 34ddba7

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
@@ -256,6 +256,21 @@ failure_path
256256
This is the route or path that the user is redirected to after a failed login attempt.
257257
It can be a relative/absolute URL or a Symfony route name.
258258

259+
form_only
260+
.........
261+
262+
**type**: ``boolean`` **default**: ``false``
263+
264+
Set this option to ``true`` to require that the login data is sent using a form
265+
(it checks that the request content-type is ``application/x-www-form-urlencoded``).
266+
This is useful for example to prevent the :ref:`form login authenticator <security-form-login>`
267+
from responding to requests that should be handled by the
268+
:ref:`JSON login authenticator <security-json-login>`.
269+
270+
.. versionadded:: 5.4
271+
272+
The ``form_only`` option was introduced in Symfony 5.4.
273+
259274
use_forward
260275
...........
261276

security.rst

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

962+
.. _security-json-login:
963+
962964
JSON Login
963965
~~~~~~~~~~
964966

0 commit comments

Comments
 (0)