0👍
Looks like response.data.api_token
is not a pure string but an object. If you change your header-setting line to:
axios.defaults.headers.common['Authorization'] = JSON.stringify(store.getters.token)
the problem should be easier to diagnose.
Also, unless you do something bespoke, you also need to set an authorization type in the header value, so that the value becomes Bearer <token>
or Basic <token>
- [Vuejs]-V-show on v-for creates unwanted return transition
- [Vuejs]-How to make dynamic props for element UI
Source:stackexchange.com