Add custom headers modal and model

This commit is contained in:
advplyr 2022-07-01 16:33:39 -05:00
parent cd4c280950
commit 317dc366e3
8 changed files with 193 additions and 59 deletions

View file

@ -4,6 +4,14 @@ export default function ({ $axios, store }) {
if (config.url.startsWith('http:') || config.url.startsWith('https:')) {
return
}
var customHeaders = store.getters['user/getCustomHeaders']
if (customHeaders) {
for (const key in customHeaders) {
config.headers.common[key] = customHeaders[key]
}
}
var bearerToken = store.getters['user/getToken']
if (bearerToken) {
config.headers.common['Authorization'] = `Bearer ${bearerToken}`