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
484484If you're using a Guard authenticator to build a login form and want to add CSRF
485485protection, no problem!
486486
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 >`.
488489
489490Then, type-hint ``CsrfTokenManagerInterface `` in your ``__construct() `` method
490491(or manually configure the ``Symfony\Component\Security\Csrf\CsrfTokenManagerInterface ``
@@ -519,11 +520,6 @@ service to be passed) and add the following logic::
519520
520521 // ...
521522 }
522-
523- .. tip ::
524-
525- Don't forget to enable `csrf_protection ` in the `config/framework.yml ` file that
526- CsrfTokenManagerInterface can get autowired.
527523
528524Frequently Asked Questions
529525--------------------------
You can’t perform that action at this time.
0 commit comments