diff options
author | Sky <git@bunnies.cc> | 2013-12-13 14:58:35 +0000 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2013-12-13 14:58:35 +0000 |
commit | b69351d50d07bab595945d064e4d29b123c19105 (patch) | |
tree | 5cf6be9ef49ad10a211a0544e5481f36e49a306a /logic/auth/flows | |
parent | 979946b7bb2cec808198f9194169ea08cce8bb00 (diff) | |
parent | 0af6f96c3de54c940799826ff6f3c89bb46f1540 (diff) | |
download | PrismLauncher-b69351d50d07bab595945d064e4d29b123c19105.tar.gz PrismLauncher-b69351d50d07bab595945d064e4d29b123c19105.tar.bz2 PrismLauncher-b69351d50d07bab595945d064e4d29b123c19105.zip |
Merge branch 'develop' of github.com:Drayshak/MultiMC5 into develop
Diffstat (limited to 'logic/auth/flows')
-rw-r--r-- | logic/auth/flows/AuthenticateTask.cpp | 12 | ||||
-rw-r--r-- | logic/auth/flows/RefreshTask.cpp | 1 |
2 files changed, 9 insertions, 4 deletions
diff --git a/logic/auth/flows/AuthenticateTask.cpp b/logic/auth/flows/AuthenticateTask.cpp index 966548ec..cc26cd1b 100644 --- a/logic/auth/flows/AuthenticateTask.cpp +++ b/logic/auth/flows/AuthenticateTask.cpp @@ -76,7 +76,7 @@ bool AuthenticateTask::processResponse(QJsonObject responseData) // Read the response data. We need to get the client token, access token, and the selected // profile. QLOG_DEBUG() << "Processing authentication response."; - + // QLOG_DEBUG() << responseData; // If we already have a client token, make sure the one the server gave us matches our // existing one. QLOG_DEBUG() << "Getting client token."; @@ -123,6 +123,7 @@ bool AuthenticateTask::processResponse(QJsonObject responseData) // Profiles are easy, we just need their ID and name. QString id = profile.value("id").toString(""); QString name = profile.value("name").toString(""); + bool legacy = profile.value("legacy").toBool(false); if (id.isEmpty() || name.isEmpty()) { @@ -134,7 +135,7 @@ bool AuthenticateTask::processResponse(QJsonObject responseData) } // Now, add a new AccountProfile entry to the list. - loadedProfiles.append({id, name}); + loadedProfiles.append({id, name, legacy}); } // Put the list of profiles we loaded into the MojangAccount object. m_account->m_profiles = loadedProfiles; @@ -166,10 +167,11 @@ bool AuthenticateTask::processResponse(QJsonObject responseData) // is it a good idea to log this? if (responseData.contains("user")) { + User u; auto obj = responseData.value("user").toObject(); - auto userId = obj.value("id").toString(); + u.id = obj.value("id").toString(); + QLOG_DEBUG() << "User ID: " << u.id ; auto propArray = obj.value("properties").toArray(); - QLOG_DEBUG() << "User ID: " << userId; QLOG_DEBUG() << "User Properties: "; for (auto prop : propArray) { @@ -177,7 +179,9 @@ bool AuthenticateTask::processResponse(QJsonObject responseData) auto name = propTuple.value("name").toString(); auto value = propTuple.value("value").toString(); QLOG_DEBUG() << name << " : " << value; + u.properties.insert(name, value); } + m_account->m_user = u; } // We've made it through the minefield of possible errors. Return true to indicate that diff --git a/logic/auth/flows/RefreshTask.cpp b/logic/auth/flows/RefreshTask.cpp index bd38eb10..16feac6e 100644 --- a/logic/auth/flows/RefreshTask.cpp +++ b/logic/auth/flows/RefreshTask.cpp @@ -67,6 +67,7 @@ bool RefreshTask::processResponse(QJsonObject responseData) // profile. QLOG_DEBUG() << "Processing authentication response."; + // QLOG_DEBUG() << responseData; // If we already have a client token, make sure the one the server gave us matches our // existing one. QString clientToken = responseData.value("clientToken").toString(""); |