Skip to content

Commit

Permalink
Only send selectedProfile when selecting a profile
Browse files Browse the repository at this point in the history
Some authentication servers (Blessing Skin) care when selectedProfile is
sent on POST /refresh but the clientToken is already bound to a profile.
We should only include selectedProfile in POST /refresh during the
initial "Add authlib-injector account" process when selecting a profile
from multiple availableProfiles.

For #50
  • Loading branch information
evan-goode committed Jan 13, 2025
1 parent 8cd807c commit a5fcdd0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions launcher/minecraft/auth/steps/YggdrasilStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,17 @@ void YggdrasilStep::refresh()
* "requestUser": true/false // request the user structure
* }
*/
QJsonObject selectedProfile;
selectedProfile.insert("id", m_data->profileId());
selectedProfile.insert("name", m_data->profileName());

QJsonObject req;
req.insert("clientToken", m_data->clientToken());
req.insert("accessToken", m_data->accessToken());
req.insert("selectedProfile", selectedProfile);

if (m_didSelectProfile) {
QJsonObject selectedProfile;
selectedProfile.insert("id", m_data->profileId());
selectedProfile.insert("name", m_data->profileName());
req.insert("selectedProfile", selectedProfile);
}
req.insert("requestUser", false);

QJsonDocument doc(req);
Expand Down

0 comments on commit a5fcdd0

Please sign in to comment.