Skip to content

Commit 4da5615

Browse files
committed
minor #8003 adding note that CSRF protection has to be enabled in config (JensPliester, javiereguiluz)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #8003). Discussion ---------- adding note that CSRF protection has to be enabled in config This issue should be mentioned in the guide. If CSRF Protection is disabled, Symfony won't find the CSRF-Token manager, implicating a missing package. But all was needed was setting csrf_protection to true in config.yml. Commits ------- 17fdd2e Reworded the help note b948747 adding note that CSRF protection has to be enabled in config
2 parents 31a0a09 + 17fdd2e commit 4da5615

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

security/csrf_in_login_form.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@ for CSRF. In this article you'll learn how you can use it in your login form.
1616
Configuring CSRF Protection
1717
---------------------------
1818

19-
First, configure the Security component so it can use CSRF protection.
20-
The Security component needs a CSRF token provider. You can set this to use the default
21-
provider available in the Security component:
19+
First, make sure that the CSRF protection is enabled in the main cofiguration
20+
file:
21+
22+
.. code-block:: yaml
23+
24+
# app/config/config.yml
25+
framework:
26+
# ...
27+
csrf_protection: ~
28+
29+
Then, the security component needs a CSRF token provider. You can set this to
30+
use the default provider available in the security component:
2231

2332
.. configuration-block::
2433

0 commit comments

Comments
 (0)