diff options
author | Kostas Karmas <konskarm@gmail.com> | 2021-04-08 13:46:52 +0300 |
---|---|---|
committer | Kostas Karmas <konskarm@gmail.com> | 2021-04-08 13:46:52 +0300 |
commit | 72080a3ccab3e0eb633b9d67af29c8025eafcac2 (patch) | |
tree | c654e5712779b15a418e26d1d26d70ca49e19e1c /cura/API | |
parent | 1e5d7623cb9a3cbd017cc730888c221a1704277a (diff) |
Delete the auth data on upgrade from 4.8 if the scope doesn't match
If the user account scope is outdated, delete it when upgrading from 4.8 to 4.9. This means that
the user will have to log in again, to make sure they get the correct account scope.
CURA-8093
Diffstat (limited to 'cura/API')
-rw-r--r-- | cura/API/Account.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cura/API/Account.py b/cura/API/Account.py index d5ef2bfcb9..4e8c90e052 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -58,6 +58,11 @@ class Account(QObject): manualSyncEnabledChanged = pyqtSignal(bool) updatePackagesEnabledChanged = pyqtSignal(bool) + CLIENT_SCOPES = "account.user.read drive.backup.read drive.backup.write packages.download " \ + "packages.rating.read packages.rating.write connect.cluster.read connect.cluster.write " \ + "library.project.read library.project.write cura.printjob.read cura.printjob.write " \ + "cura.mesh.read cura.mesh.write" + def __init__(self, application: "CuraApplication", parent = None) -> None: super().__init__(parent) self._application = application @@ -79,10 +84,7 @@ class Account(QObject): CALLBACK_PORT=self._callback_port, CALLBACK_URL="http://localhost:{}/callback".format(self._callback_port), CLIENT_ID="um----------------------------ultimaker_cura", - CLIENT_SCOPES="account.user.read drive.backup.read drive.backup.write packages.download " - "packages.rating.read packages.rating.write connect.cluster.read connect.cluster.write " - "library.project.read library.project.write cura.printjob.read cura.printjob.write " - "cura.mesh.read cura.mesh.write", + CLIENT_SCOPES=self.CLIENT_SCOPES, AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data", AUTH_SUCCESS_REDIRECT="{}/app/auth-success".format(self._oauth_root), AUTH_FAILED_REDIRECT="{}/app/auth-error".format(self._oauth_root) |