simplify csrf token retrieval. remove package.
This commit is contained in:
parent
e6cc60349d
commit
9c0278274b
|
@ -8,7 +8,6 @@
|
||||||
"bootstrap-sass": "^3.3.7",
|
"bootstrap-sass": "^3.3.7",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"jquery": "^3.1.0",
|
"jquery": "^3.1.0",
|
||||||
"js-cookie": "^2.1.2",
|
|
||||||
"laravel-elixir": "^6.0.0-9",
|
"laravel-elixir": "^6.0.0-9",
|
||||||
"laravel-elixir-vue": "^0.1.4",
|
"laravel-elixir-vue": "^0.1.4",
|
||||||
"laravel-elixir-webpack-official": "^1.0.2",
|
"laravel-elixir-webpack-official": "^1.0.2",
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
window._ = require('lodash');
|
window._ = require('lodash');
|
||||||
window.Cookies = require('js-cookie');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
|
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
|
||||||
|
@ -27,7 +26,7 @@ require('vue-resource');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Vue.http.interceptors.push(function (request, next) {
|
Vue.http.interceptors.push(function (request, next) {
|
||||||
request.headers['X-XSRF-TOKEN'] = Cookies.get('XSRF-TOKEN');
|
request.headers['X-XSRF-TOKEN'] = Laravel.csrfToken;
|
||||||
|
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue