FiguredLimited / vue-mc

Models and Collections for Vue
https://vuemc.io
MIT License
627 stars 98 forks source link

Define global Axios configuration #156

Open skuhnow opened 4 years ago

skuhnow commented 4 years ago

I use vue-mc with NuxtJS and Symfony as my Backend. Authentication with json_login. To make the login/auth work, I have to extend the axios config for every request with

export default function ({ $axios }) {
  $axios.onRequest((config) => {
    config.withCredentials = true

    return config
  })
}

Also, i defined the base url of my API endpoint in my NuxtJS config

axios: {
  baseURL: process.env.API_BASE_URL || 'http://local.dev:8000',
},

Both is ignored by vue-mc (although vue-mc seems to use axios internally)

tmeisel commented 3 years ago

Maybe this one helps: https://github.com/FiguredLimited/vue-mc/issues/23