mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-24 21:49:12 -06:00
13 lines
292 B
JavaScript
13 lines
292 B
JavaScript
import axios from 'axios'
|
|
|
|
export function injectAuthToken (token) {
|
|
axios.interceptors.request.use(config => {
|
|
if (typeof config.headers.Authorization === 'undefined') {
|
|
if (token) {
|
|
config.headers.Authorization = `Bearer ${token}`
|
|
}
|
|
}
|
|
return config
|
|
})
|
|
}
|