Skip to content

Commit 67abf21

Browse files
Update recipes 2025-08-21 (#152)
1 parent e9a9add commit 67abf21

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
@@ -33,8 +33,8 @@ export function generateCsrfToken (formElement) {
3333
if (!csrfCookie && nameCheck.test(csrfToken)) {
3434
csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken);
3535
csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18))));
36-
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
3736
}
37+
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
3838

3939
if (csrfCookie && tokenCheck.test(csrfToken)) {
4040
const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict';

0 commit comments

Comments
 (0)