Skip to content

Commit 24fa85c

Browse files
committed
Remove X-CSRF-TOKEN header from Axios instance
1 parent f7e3e25 commit 24fa85c

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

Diff for: src/Presets/bootstrap-stubs/bootstrap.js

-14
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,6 @@ window.axios = require('axios');
2323

2424
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
2525

26-
/**
27-
* Next we will register the CSRF Token as a common header with Axios so that
28-
* all outgoing HTTP requests automatically have it attached. This is just
29-
* a simple convenience so we don't have to attach every token manually.
30-
*/
31-
32-
let token = document.head.querySelector('meta[name="csrf-token"]');
33-
34-
if (token) {
35-
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
36-
} else {
37-
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
38-
}
39-
4026
/**
4127
* Echo exposes an expressive API for subscribing to channels and listening
4228
* for events that are broadcast by Laravel. Echo and event broadcasting

0 commit comments

Comments
 (0)