include csrf token and fix escaping for admin scripts
This commit is contained in:
3
resources/js/bootstrap.js
vendored
3
resources/js/bootstrap.js
vendored
@@ -24,6 +24,9 @@ const token = document.head.querySelector('meta[name="csrf-token"]');
|
||||
|
||||
if (token) {
|
||||
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
|
||||
window.jquery.ajaxSetup({
|
||||
'X-CSRF-TOKEN': token.content
|
||||
})
|
||||
} else {
|
||||
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user