mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 09:17:50 -06:00
Don't drop refresh token if request failed
This commit is contained in:
parent
62f913802f
commit
a8128556f3
1 changed files with 6 additions and 2 deletions
|
@ -121,8 +121,12 @@ class AuthorizationService:
|
||||||
if self._auth_data is None or self._auth_data.refresh_token is None:
|
if self._auth_data is None or self._auth_data.refresh_token is None:
|
||||||
Logger.log("w", "Unable to refresh access token, since there is no refresh token.")
|
Logger.log("w", "Unable to refresh access token, since there is no refresh token.")
|
||||||
return
|
return
|
||||||
self._storeAuthData(self._auth_helpers.getAccessTokenUsingRefreshToken(self._auth_data.refresh_token))
|
response = self._auth_helpers.getAccessTokenUsingRefreshToken(self._auth_data.refresh_token)
|
||||||
self.onAuthStateChanged.emit(logged_in=True)
|
if response.success:
|
||||||
|
self._storeAuthData(response)
|
||||||
|
self.onAuthStateChanged.emit(logged_in=True)
|
||||||
|
else:
|
||||||
|
self.onAuthStateChanged(logged_in = False)
|
||||||
|
|
||||||
# Delete the authentication data that we have stored locally (eg; logout)
|
# Delete the authentication data that we have stored locally (eg; logout)
|
||||||
def deleteAuthData(self) -> None:
|
def deleteAuthData(self) -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue