Browse Source

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
Wayne Harris 7 years ago
parent
commit
76db1006cc
2 changed files with 2 additions and 2 deletions
  1. 1 1
      package.json
  2. 1 1
      resources/assets/js/bootstrap.js

+ 1 - 1
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"
   }
 }

+ 1 - 1
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();
 });