Merge pull request #1621 from PolyMC/fix-msa-login

Fix MSA profile fetching
This commit is contained in:
Lenny McLennington 2023-12-17 10:54:51 +00:00 committed by GitHub
commit 24c471de88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,21 +7,7 @@
#include "net/NetUtils.h"
MinecraftProfileStep::MinecraftProfileStep(AccountData* data) : AuthStep(data) {
switch (m_data->type)
{
case AccountType::Mojang: {
baseUrl = "https://api.minecraftservices.com";
break;
}
case AccountType::AuthlibInjector: {
baseUrl = m_data->authlibInjectorApiLocation + "/minecraftservices";
break;
}
// Silence warnings about unhandled enum values for values we know shouldn't be handled.
case AccountType::MSA:
case AccountType::Offline:
break;
}
}
MinecraftProfileStep::~MinecraftProfileStep() noexcept = default;
@ -32,7 +18,7 @@ QString MinecraftProfileStep::describe() {
void MinecraftProfileStep::perform() {
QUrl url = baseUrl + "/minecraft/profile";
auto url = QUrl("https://api.minecraftservices.com/minecraft/profile");
QNetworkRequest request = QNetworkRequest(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_data->yggdrasilToken.token).toUtf8());