File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -484,7 +484,8 @@ Adding CSRF Protection
484
484
If you're using a Guard authenticator to build a login form and want to add CSRF
485
485
protection, no problem!
486
486
487
- First, :ref: `add the _csrf_token to your login template <csrf-login-template >`.
487
+ First, check that :ref: `the csrf_protection option <reference-framework-csrf-protection >`
488
+ is enabled and :ref: `add the _csrf_token field to your login form <csrf-login-template >`.
488
489
489
490
Then, type-hint ``CsrfTokenManagerInterface `` in your ``__construct() `` method
490
491
(or manually configure the ``Symfony\Component\Security\Csrf\CsrfTokenManagerInterface ``
@@ -519,11 +520,6 @@ service to be passed) and add the following logic::
519
520
520
521
// ...
521
522
}
522
-
523
- .. tip ::
524
-
525
- Don't forget to enable `csrf_protection ` in the `config/framework.yml ` file that
526
- CsrfTokenManagerInterface can get autowired.
527
523
528
524
Frequently Asked Questions
529
525
--------------------------
You can’t perform that action at this time.
0 commit comments