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.
_token
_csrf_token
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
I'm suggesting to change the default name of the automatically generated CSRF token form field from _token to _csrf_token. I think it's happening at https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php#L35
Oddly enough, the docs at https://symfony.com/doc/current/security/csrf.html#csrf-protection-in-symfony-forms are falsely claiming that it is called _csrf_token. But instead of changing the docs, I'm suggesting to change the feature, cause _csrf_token is certainly a better name.
No response
The text was updated successfully, but these errors were encountered:
Works for me: the CSRF field in the Security component is also named _csrf_token and https://github.com/symfony/recipes/blob/main/symfony/stimulus-bundle/2.20/assets/controllers/csrf_protection_controller.js has a rule for _csrf_token, not _token (even if changing the name isn't strictly required since the data attribute is enough.
Up for a PR?
Sorry, something went wrong.
Well, "with a little help from my friends"... :-) On the 7.3 branch?
Let's go with branch 7.3 yes
[Form] Changing CSRF token default name symfony#60534
8facc67
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
Description
I'm suggesting to change the default name of the automatically generated CSRF token form field from
_token
to_csrf_token
.I think it's happening at https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php#L35
Oddly enough, the docs at https://symfony.com/doc/current/security/csrf.html#csrf-protection-in-symfony-forms are falsely claiming that it is called
_csrf_token
. But instead of changing the docs, I'm suggesting to change the feature, cause_csrf_token
is certainly a better name.Example
No response
The text was updated successfully, but these errors were encountered: