diff --git a/frontend/src/main.js b/frontend/src/main.js index 574fd29..270e2e4 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -2,6 +2,16 @@ import Vue from "vue"; import App from "./App.vue"; import router from "./router"; import vuetify from './plugins/vuetify'; +import axios from "axios" + +// JWT will be injected automatically when available +axios.interceptors.request.use(config => { + let token = sessionStorage.getItem("jwt") + if (token) { + config.headers.Authorization = token + } + return config +}) Vue.config.productionTip = false;