Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
aaa39244
Commit
aaa39244
authored
Aug 29, 2018
by
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
Changes
1
Show whitespace changes
Inline
Side-by-side
app/utils/url.js
View file @
aaa39244
...
...
@@ -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
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment