Skip to content

Commit

Permalink
fix: do not show renkulab down when the users auth token has expired (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ciyer authored Apr 12, 2022
1 parent ad02c3d commit 7c73834
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions client/src/api-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ class APIClient {
) {
return renkuFetch(url, options)
.catch((error) => {
if (error.case === API_ERRORS.authExpired)
return this.doLogin();
if (error.case === API_ERRORS.authExpired) {
this.doLogin();
return Promise.reject(error);
}
// For permission errors we send the user to login
if (reLogin && error.case === API_ERRORS.unauthorizedError)
return this.doLogin();
Expand Down
2 changes: 1 addition & 1 deletion client/src/user/User.state.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class UserCoordinator {
data: { $set: {} }
};
// we get 401 unauthorized when the user is not logged in, but that's not an error
if (error.case !== API_ERRORS.unauthorizedError)
if (error.case !== API_ERRORS.unauthorizedError && error.case !== API_ERRORS.authExpired)
errorObject.error = status;
this.model.setObject(errorObject);

Expand Down

0 comments on commit 7c73834

Please sign in to comment.