mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-15 13:51:35 +00:00
don't set Bearer header for proxyAuth users
This commit is contained in:
parent
74e3560153
commit
b39b66a746
1 changed files with 5 additions and 4 deletions
|
|
@ -7,9 +7,10 @@ export default function ({ $axios, store, $config }) {
|
|||
if (config.url.startsWith('http:') || config.url.startsWith('https:')) {
|
||||
return
|
||||
}
|
||||
const bearerToken = store.state.user.user?.token || null
|
||||
if (bearerToken) {
|
||||
config.headers.common['Authorization'] = `Bearer ${bearerToken}`
|
||||
|
||||
const user = store.state.user.user
|
||||
if (user && user.token && !user.isFromProxy) {
|
||||
config.headers.common['Authorization'] = `Bearer ${user.token}`
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
|
|
@ -23,4 +24,4 @@ export default function ({ $axios, store, $config }) {
|
|||
const message = error.response ? error.response.data || 'Unknown Error' : 'Unknown Error'
|
||||
console.error('Axios error', code, message)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue