8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On the form component documentation it says to use this example for csrf protection under version 6
use Symfony\Component\Form\Extension\Csrf\CsrfExtension; use Symfony\Component\Form\Forms; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\Security\Csrf\CsrfTokenManager; use Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator; use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage; // creates a Session object from the HttpFoundation component $session = new Session(); $csrfGenerator = new UriSafeTokenGenerator(); $csrfStorage = new SessionTokenStorage($session); $csrfManager = new CsrfTokenManager($csrfGenerator, $csrfStorage); $formFactory = Forms::createFormFactoryBuilder() // ... ->addExtension(new CsrfExtension($csrfManager)) ->getFormFactory();
But in symfony 6, $csrfStorage = new SessionTokenStorage() expects RequestStack.
$csrfStorage = new SessionTokenStorage()
The text was updated successfully, but these errors were encountered:
bug #15441 [Form] Fixed a code example related to CSRF (javiereguiluz)
6d5073d
This PR was merged into the 5.3 branch. Discussion ---------- [Form] Fixed a code example related to CSRF Fixes #15410 but proposes the fix in 5.3 branch because that's where the deprecation was introduced: https://github.com/symfony/security-csrf/blob/c7b7006d3ed955da978a002d764cae388bed8d09/TokenStorage/SessionTokenStorage.php#L47-L59 Commits ------- b4f0e04 [Form] Fixed a code example related to CSRF
No branches or pull requests
On the form component documentation it says to use this example for csrf protection under version 6
But in symfony 6,
$csrfStorage = new SessionTokenStorage()
expects RequestStack.The text was updated successfully, but these errors were encountered: