mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Delete existing log-in information to force the user to log in again
Otherwise they won't be able to sync material profiles. Contributes to issue CURA-8609.
This commit is contained in:
parent
bf6dd443b2
commit
5ed57e403c
1 changed files with 23 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import io
|
import io
|
||||||
|
import json
|
||||||
import os.path
|
import os.path
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
|
|
||||||
|
@ -49,6 +50,28 @@ class VersionUpgrade411to412(VersionUpgrade):
|
||||||
# Update version number.
|
# Update version number.
|
||||||
parser["metadata"]["setting_version"] = "19"
|
parser["metadata"]["setting_version"] = "19"
|
||||||
|
|
||||||
|
# If the account scope in 4.11 is outdated, delete it so that the user is enforced to log in again and get the
|
||||||
|
# correct permissions.
|
||||||
|
new_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",
|
||||||
|
"cura.material.write"}
|
||||||
|
if "ultimaker_auth_data" in parser["general"]:
|
||||||
|
ultimaker_auth_data = json.loads(parser["general"]["ultimaker_auth_data"])
|
||||||
|
if new_scopes - set(ultimaker_auth_data["scope"].split(" ")):
|
||||||
|
parser["general"]["ultimaker_auth_data"] = "{}"
|
||||||
|
|
||||||
result = io.StringIO()
|
result = io.StringIO()
|
||||||
parser.write(result)
|
parser.write(result)
|
||||||
return [filename], [result.getvalue()]
|
return [filename], [result.getvalue()]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue