We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97af9a8 commit bfbc7f4Copy full SHA for bfbc7f4
src/ViewProduct.vue
@@ -54,11 +54,6 @@
54
55
<script>
56
export default {
57
- http: {
58
- headers: {
59
- 'X-CSRF-TOKEN': 'VERY_SECURE_TOKEN_HERE'
60
- }
61
- },
62
props: {
63
productId: {
64
required: true
src/main.js
@@ -56,6 +56,13 @@ Vue.use(VueResource);
Vue.http.options.root = 'http://localhost:3000';
Vue.http.headers.common['X-Requested-With'] = 'XMLHttpRequest';
+Vue.http.interceptors.push((request, next) => {
+ request.headers.set('X-CSRF-TOKEN', 'VERY_SECURE_TOKEN_HERE');
+ next((response) => {
+ console.log(response);
+ });
+});
65
+
66
/* eslint-disable no-new */
67
new Vue({
68
el: '#app',
0 commit comments