Add csrf component
This commit is contained in:
parent
598bae7b70
commit
94710934b9
4 changed files with 33 additions and 0 deletions
|
@ -30,6 +30,7 @@ let token = document.head.querySelector('meta[name="csrf-token"]');
|
|||
|
||||
if (token) {
|
||||
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
|
||||
window.X_CSRF_TOKEN = token.content;
|
||||
} else {
|
||||
console.error('CSRF token not found in document.');
|
||||
}
|
||||
|
|
Reference in a new issue