diff options
author | fieldOfView <aldo@fieldofview.com> | 2021-05-24 19:42:17 +0300 |
---|---|---|
committer | fieldOfView <aldo@fieldofview.com> | 2021-05-24 19:43:05 +0300 |
commit | be06108f36e3d08974e4b652ef64317e91cfb64f (patch) | |
tree | 6463c2f03cb2dea7f7f2acb38b12856e3aacf943 /cura/OAuth2/AuthorizationService.py | |
parent | cfb32bfd50226ccd1ca20ba76aeb068b08143002 (diff) |
Fix an crash when starting Cura without a network connection
Diffstat (limited to 'cura/OAuth2/AuthorizationService.py')
-rw-r--r-- | cura/OAuth2/AuthorizationService.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py index da654b52bb..96091f9c11 100644 --- a/cura/OAuth2/AuthorizationService.py +++ b/cura/OAuth2/AuthorizationService.py @@ -113,8 +113,10 @@ class AuthorizationService: # The token could not be refreshed using the refresh token. We should login again. return None # Ensure it gets stored as otherwise we only have it in memory. The stored refresh token has been deleted - # from the server already. - self._storeAuthData(self._auth_data) + # from the server already. Do not store the auth_data if we could not get new auth_data (eg due to a + # network error), since this would cause an infinite loop trying to get new auth-data + if self._auth_data.success: + self._storeAuthData(self._auth_data) return self._auth_helpers.parseJWT(self._auth_data.access_token) def getAccessToken(self) -> Optional[str]: |