diff --git a/client/src/api-client/index.js b/client/src/api-client/index.js index bca10a1a99..1fea2cd74a 100644 --- a/client/src/api-client/index.js +++ b/client/src/api-client/index.js @@ -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(); diff --git a/client/src/user/User.state.js b/client/src/user/User.state.js index a576e954f7..6c9b4b92a1 100644 --- a/client/src/user/User.state.js +++ b/client/src/user/User.state.js @@ -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);