From 5b8401e1786ccb04ac3e6f538a65530a91867954 Mon Sep 17 00:00:00 2001 From: Arjan Weurding Date: Wed, 10 May 2017 15:03:33 +0200 Subject: [PATCH] Make window.Laravel.csrfToken unneccesarry I don't like the fact we have to add ``` ``` To have it working, when the docs suggest adding only the meta tag. This will get the token from the meta tag. --- resources/assets/js/bootstrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js index b5d26021..cd8d6b31 100644 --- a/resources/assets/js/bootstrap.js +++ b/resources/assets/js/bootstrap.js @@ -21,7 +21,7 @@ try { window.axios = require('axios'); -window.axios.defaults.headers.common['X-CSRF-TOKEN'] = window.Laravel.csrfToken; +window.axios.defaults.headers.common['X-CSRF-TOKEN'] = document.head.querySelector('meta[name="csrf-token"]').content; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; /**