Skip to content

Commit a505c80

Browse files
committed
[stimulus-bundle] Fix broken CSRF header generation with Turbo forms
1 parent 452e626 commit a505c80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

symfony/stimulus-bundle/2.20/assets/controllers/csrf_protection_controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ document.addEventListener('submit', function (event) {
99
// When @hotwired/turbo handles form submissions, send the CSRF token in a header in addition to a cookie
1010
// The `framework.csrf_protection.check_header` config option needs to be enabled for the header to be checked
1111
document.addEventListener('turbo:submit-start', function (event) {
12-
const h = generateCsrfHeaders(event.detail.formSubmission);
12+
const h = generateCsrfHeaders(event.detail.formSubmission.formElement);
1313
Object.keys(h).map(function (k) {
1414
event.detail.formSubmission.fetchRequest.headers[k] = h[k];
1515
});

0 commit comments

Comments
 (0)