fix(core) Token should be added to headers instead of replacing them
This commit is contained in:
parent
acf1816b55
commit
cb43b8a39b
|
@ -54,7 +54,9 @@ export default boot(({ router }) => {
|
||||||
api.interceptors.request.use((config) => {
|
api.interceptors.request.use((config) => {
|
||||||
const store = useMainStore();
|
const store = useMainStore();
|
||||||
if (store.session?.token) {
|
if (store.session?.token) {
|
||||||
config.headers = { Authorization: 'Bearer ' + store.session.token };
|
config.headers = Object.assign(config.headers || {}, {
|
||||||
|
Authorization: `Bearer ${store.session.token}`,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Minify JSON requests
|
// Minify JSON requests
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue