Skip to content

Commit

Permalink
Move stateless CSRF config to packages/csrf.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 20, 2024
1 parent fc87603 commit e052d34
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions symfony/form/7.2/config/packages/csrf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Enable stateless CSRF protection for forms and logins/logouts
framework:
form:
csrf_protection:
token_id: submit

csrf_protection:
stateless_token_ids:
- submit
- authenticate
- logout
5 changes: 5 additions & 0 deletions symfony/form/7.2/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
}
}
5 changes: 0 additions & 5 deletions symfony/framework-bundle/7.2/config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ framework:
#esi: true
#fragments: true

# Enable stateless CSRF protection for forms and logins/logouts
form: { csrf_protection: { token_id: submit } }
csrf_protection:
stateless_token_ids: [submit, authenticate, logout]

when@test:
framework:
test: true
Expand Down

0 comments on commit e052d34

Please sign in to comment.