mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Sync after log in works again
Needed to restore the access token after the auth data was written to the preference file. CURA-7180 keyring storage
This commit is contained in:
parent
fcf698f00b
commit
96e39810f2
1 changed files with 6 additions and 5 deletions
|
@ -267,17 +267,18 @@ class AuthorizationService:
|
|||
self._user_profile = self.getUserProfile()
|
||||
|
||||
# Store all the sensitive stuff in the keyring
|
||||
# Don't store the access_token, as it's very long and that (or tried workarounds) causes issues on Windows.
|
||||
self._secret_storage["refresh_token"] = auth_data.refresh_token
|
||||
|
||||
# The access_token will still be stored in the preference file on windows, due to a 255 length limitation
|
||||
self._secret_storage["access_token"] = auth_data.access_token
|
||||
|
||||
|
||||
# And remove that data again so it isn't stored in the preferences.
|
||||
# Keep the access_token, as it's very long and that (or tried workarounds) causes issues on Windows.
|
||||
# Store the data in the preference, setting both tokens to None so they won't be written
|
||||
auth_data.refresh_token = None
|
||||
auth_data.access_token = None
|
||||
|
||||
self._preferences.setValue(self._settings.AUTH_DATA_PREFERENCE_KEY, json.dumps(vars(auth_data)))
|
||||
|
||||
# restore access token so that syncing for the current session doesn't fail
|
||||
auth_data.access_token = self._secret_storage["access_token"]
|
||||
else:
|
||||
self._user_profile = None
|
||||
self._preferences.resetPreference(self._settings.AUTH_DATA_PREFERENCE_KEY)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue