Commit 80c09dd
Error in CSRF example code snippet
Something's wrong when I tried this code:
`$formFactory = Forms::createFormFactoryBuilder()`
` // ...`
` ->addExtension(new CsrfExtension($csrfStorage))`
` ->getFormFactory();`
Constructing a `CsrfExtension` requires a `CsrfTokenManagerInterface` as an argument (see symfony/form/Extension/Csrf/CsrfExtension.php, line 24).
The `$csrfStorage` in `addExtension(new CsrfExtension($csrfStorage)`, has a class that implements `TokenStorageInterface` (see symfony/security-csrf/TokenStorage/SessionStorageToken.php, line 22).
So I replaced it with `$csrfManager` that has class that implement `CsrfTokenManagerInterface`. (see symfony/security-csrf/CsrfTokenManager.php, line 24)1 parent 0e9c462 commit 80c09dd
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
0 commit comments