diff --git a/EDMarketConnector.py b/EDMarketConnector.py index ca30c484..7c13a739 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1075,6 +1075,13 @@ class AppWindow(object): # TODO: Set status text return + except companion.CredentialsError: + # Redirected back to Auth server - force full re-authentication + companion.session.dump(r) + companion.session.invalidate() + companion.session.retrying = False + companion.session.login() + # Companion API problem except companion.ServerLagging as e: err = str(e) diff --git a/companion.py b/companion.py index 7c67a892..4cca98da 100644 --- a/companion.py +++ b/companion.py @@ -642,12 +642,10 @@ class Session(object): if r.url.startswith(SERVER_AUTH): logger.info('Redirected back to Auth Server') - # Redirected back to Auth server - force full re-authentication - self.dump(r) - self.invalidate() - self.retrying = False - self.login() - raise CredentialsError() + self.capi_response_queue.put( + CAPIFailedRequest(f'Redirected back to Auth Server', exception=CredentialsError() + ) + continue elif 500 <= r.status_code < 600: # Server error. Typically 500 "Internal Server Error" if server is down @@ -656,6 +654,10 @@ class Session(object): # LANG: Frontier CAPI data retrieval failed with 5XX code raise ServerError(f'{_("Frontier CAPI server error")}: {r.status_code}') + self.capi_response_queue.put( + data + ) + logger.info('CAPI worker thread DONE') def capi_query_close_worker(self) -> None: