Fix some API calls that should not use an API token (#30401)
This commit is contained in:
parent
2c5ab8f647
commit
15d3070754
7 changed files with 9 additions and 9 deletions
|
@ -40,11 +40,11 @@ const authorizationTokenFromInitialState = (): RawAxiosRequestHeaders => {
|
|||
};
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function api() {
|
||||
export default function api(withAuthorization = true) {
|
||||
return axios.create({
|
||||
headers: {
|
||||
...csrfHeader,
|
||||
...authorizationTokenFromInitialState(),
|
||||
...(withAuthorization ? authorizationTokenFromInitialState() : {}),
|
||||
},
|
||||
|
||||
transformResponse: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue