Commit aaa39244 authored by Gijs Hendriksen's avatar Gijs Hendriksen
Browse files

Merge branch 'fix/detect-invalid-token' into 'master'

Fix detectInvalidToken in case of empty response

See merge request !190
parents 2a3ed733 22b16bfa
......@@ -32,6 +32,7 @@ export class TokenInvalidError extends Error {
const detectInvalidToken = (response) => {
const responseCopy = response.clone();
if (response.status === 403) {
return response.json().then((json) => {
if (response.status === 403) {
const contentLang = response.headers.get('content-language');
......@@ -42,6 +43,8 @@ const detectInvalidToken = (response) => {
}
return responseCopy;
});
}
return Promise.resolve(responseCopy);
};
export const apiRequest = (route, fetchOpts, params) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment