Skip to content

Commit

Permalink
refs #2889 Remove manual CSRF token handling on Turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna committed Sep 2, 2024
1 parent 92f2737 commit 52d5224
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions resources/js/controllers/html_load_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ export default class extends ApplicationController {
initialize() {
this.axios();
this.csrf();

document.addEventListener('turbo:load', () => {
this.csrf();
});
}

/**
Expand Down Expand Up @@ -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;
});

}

/**
Expand Down

0 comments on commit 52d5224

Please sign in to comment.