feat: remove unneeded null coalescing assignment
axios headers are now alway present (according to the typings) Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2337>
This commit is contained in:
parent
1d7b4a639e
commit
73e12e0e54
|
@ -9,6 +9,7 @@ import moment from 'moment'
|
|||
import axios from 'axios'
|
||||
|
||||
import useLogger from '~/composables/useLogger'
|
||||
import { getDepOptimizationConfig } from 'vite'
|
||||
|
||||
const { t } = i18n.global
|
||||
const logger = useLogger()
|
||||
|
@ -18,8 +19,7 @@ export const install: InitModule = ({ store, router }) => {
|
|||
axios.defaults.xsrfHeaderName = 'X-CSRFToken'
|
||||
axios.interceptors.request.use(function (config) {
|
||||
// Do something before request is sent
|
||||
if (store.state.auth.oauth.accessToken) {
|
||||
config.headers ??= {}
|
||||
if (store.state.auth.oauth.accesscToken) {
|
||||
config.headers.Authorization = store.getters['auth/header']
|
||||
}
|
||||
return config
|
||||
|
@ -133,7 +133,6 @@ export const install: InitModule = ({ store, router }) => {
|
|||
}
|
||||
|
||||
if (failedRequest.response) {
|
||||
failedRequest.response.config.headers ??= {}
|
||||
failedRequest.response.config.headers.Authorization = store.getters['auth/header']
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue