Skip to content

Commit 52d5224

Browse files
committed
refs #2889 Remove manual CSRF token handling on Turbo
1 parent 92f2737 commit 52d5224

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

resources/js/controllers/html_load_controller.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ export default class extends ApplicationController {
88
initialize() {
99
this.axios();
1010
this.csrf();
11-
12-
document.addEventListener('turbo:load', () => {
13-
this.csrf();
14-
});
1511
}
1612

1713
/**
@@ -40,11 +36,6 @@ export default class extends ApplicationController {
4036
*/
4137
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
4238
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
43-
44-
document.addEventListener("turbo:before-fetch-request", (event) => {
45-
event.detail.fetchOptions.headers["X-CSRF-TOKEN"] = token.content;
46-
});
47-
4839
}
4940

5041
/**

0 commit comments

Comments
 (0)