aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-02-18 12:25:26 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2022-02-18 12:32:24 +0100
commitbe910374dc81225863a55c1ada23074b0cb5f219 (patch)
treedc420fffe0ffb597e8d5f6aee1af315fab2901d1
parent12c8a044584019302137de41ae5e437eafefa7bf (diff)
downloadPrismLauncher-be910374dc81225863a55c1ada23074b0cb5f219.tar.gz
PrismLauncher-be910374dc81225863a55c1ada23074b0cb5f219.tar.bz2
PrismLauncher-be910374dc81225863a55c1ada23074b0cb5f219.zip
feat(accounts): support msa-client-id value
-rw-r--r--launcher/minecraft/auth/AccountData.cpp5
-rw-r--r--launcher/minecraft/auth/AccountData.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/launcher/minecraft/auth/AccountData.cpp b/launcher/minecraft/auth/AccountData.cpp
index 9b84fe1a..f791db14 100644
--- a/launcher/minecraft/auth/AccountData.cpp
+++ b/launcher/minecraft/auth/AccountData.cpp
@@ -327,6 +327,10 @@ bool AccountData::resumeStateFromV3(QJsonObject data) {
}
if(type == AccountType::MSA) {
+ auto clientIDV = data.value("msa-client-id");
+ if (clientIDV.isString()) {
+ msaClientID = clientIDV.toString();
+ } // leave msaClientID empty if it doesn't exist or isn't a string
msaToken = tokenFromJSONV3(data, "msa");
userToken = tokenFromJSONV3(data, "utoken");
xboxApiToken = tokenFromJSONV3(data, "xrp-main");
@@ -360,6 +364,7 @@ QJsonObject AccountData::saveState() const {
}
else if (type == AccountType::MSA) {
output["type"] = "MSA";
+ output["msa-client-id"] = msaClientID;
tokenToJSONV3(output, msaToken, "msa");
tokenToJSONV3(output, userToken, "utoken");
tokenToJSONV3(output, xboxApiToken, "xrp-main");
diff --git a/launcher/minecraft/auth/AccountData.h b/launcher/minecraft/auth/AccountData.h
index 606c1ad1..1b6867de 100644
--- a/launcher/minecraft/auth/AccountData.h
+++ b/launcher/minecraft/auth/AccountData.h
@@ -81,6 +81,7 @@ struct AccountData {
bool legacy = false;
bool canMigrateToMSA = false;
+ QString msaClientID;
Katabasis::Token msaToken;
Katabasis::Token userToken;
Katabasis::Token xboxApiToken;