[Glitch] Fix some API calls that should not use an API token

Port 15d3070754 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput
2024-05-23 09:30:48 +02:00
committed by Claire
parent 0e8633f6c7
commit c465ef7560
7 changed files with 9 additions and 9 deletions

View File

@@ -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: [