From 76db1006cca54f0364b313bef604ac59c5f9b1f0 Mon Sep 17 00:00:00 2001 From: Wayne Harris Date: Thu, 22 Sep 2016 10:36:43 +0100 Subject: [PATCH] Update Vue Resource Propose updating Vue Resource. Will require changing the way the X-CSRF-TOKEN header in bootstrap.js This seems to be compatible with Larval Passport --- package.json | 2 +- resources/assets/js/bootstrap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d490671c..4c6745cd 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,6 @@ "laravel-elixir-webpack-official": "^1.0.2", "lodash": "^4.14.0", "vue": "^1.0.26", - "vue-resource": "^0.9.3" + "vue-resource": "^1.0.2" } } diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js index 3f4c5cf5..a2f3529f 100644 --- a/resources/assets/js/bootstrap.js +++ b/resources/assets/js/bootstrap.js @@ -26,7 +26,7 @@ require('vue-resource'); */ Vue.http.interceptors.push((request, next) => { - request.headers['X-CSRF-TOKEN'] = Laravel.csrfToken; + request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken); next(); });