feat(accounts): support msa-client-id value

This commit is contained in:
Sefa Eyeoglu 2022-02-18 12:25:26 +01:00
parent 12c8a04458
commit be910374dc
No known key found for this signature in database
GPG Key ID: C10411294912A422
2 changed files with 6 additions and 0 deletions

View File

@ -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");

View File

@ -81,6 +81,7 @@ struct AccountData {
bool legacy = false;
bool canMigrateToMSA = false;
QString msaClientID;
Katabasis::Token msaToken;
Katabasis::Token userToken;
Katabasis::Token xboxApiToken;