diff --git a/resources/js/controllers/html_load_controller.js b/resources/js/controllers/html_load_controller.js index 3a9392d9c..6b2956b9b 100644 --- a/resources/js/controllers/html_load_controller.js +++ b/resources/js/controllers/html_load_controller.js @@ -8,10 +8,6 @@ export default class extends ApplicationController { initialize() { this.axios(); this.csrf(); - - document.addEventListener('turbo:load', () => { - this.csrf(); - }); } /** @@ -40,11 +36,6 @@ export default class extends ApplicationController { */ window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; - - document.addEventListener("turbo:before-fetch-request", (event) => { - event.detail.fetchOptions.headers["X-CSRF-TOKEN"] = token.content; - }); - } /**