import { boot } from 'quasar/wrappers'; import axios from 'axios'; import { useSession } from 'src/composables/useSession'; export default boot(() => { const { getToken } = useSession(); axios.defaults.baseURL = '/api/'; axios.interceptors.request.use( function (context) { const token = getToken(); if (token.length && context.headers) { context.headers.Authorization = token; } return context; }, function (error) { return Promise.reject(error); } ); });