auth: improve status messages

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle
2026-01-12 16:48:04 +05:00
parent 5a6f94fe79
commit 6cddc28e9b
8 changed files with 13 additions and 13 deletions

View File

@@ -75,7 +75,7 @@ bool getBool(QJsonValue value, bool& out)
"Message":"",
"Redirect":"https://start.ui.xboxlive.com/AddChildToFamily"
}
// 2148916233 = missing XBox account
// 2148916233 = missing Xbox account
// 2148916238 = child account not linked to a family
*/

View File

@@ -14,7 +14,7 @@ LauncherLoginStep::LauncherLoginStep(AccountData* data) : AuthStep(data) {}
QString LauncherLoginStep::describe()
{
return tr("Accessing Mojang services.");
return tr("Fetching Minecraft access token");
}
void LauncherLoginStep::perform()
@@ -69,5 +69,5 @@ void LauncherLoginStep::onRequestDone()
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("Failed to parse the Minecraft access token response."));
return;
}
emit finished(AccountTaskState::STATE_WORKING, tr(""));
emit finished(AccountTaskState::STATE_WORKING, tr("Got Minecraft access token"));
}

View File

@@ -272,5 +272,5 @@ void MSADeviceCodeStep::authenticationFinished()
m_data->msaToken.extra = rsp.extra;
m_data->msaToken.refresh_token = rsp.refresh_token;
m_data->msaToken.token = rsp.access_token;
emit finished(AccountTaskState::STATE_WORKING, tr("Got"));
emit finished(AccountTaskState::STATE_WORKING, tr("Got MSA token"));
}

View File

@@ -116,7 +116,7 @@ MSAStep::MSAStep(AccountData* data, bool silent) : AuthStep(data), m_silent(sile
m_data->msaToken.extra = m_oauth2.extraTokens();
m_data->msaToken.refresh_token = m_oauth2.refreshToken();
m_data->msaToken.token = m_oauth2.token();
emit finished(AccountTaskState::STATE_WORKING, tr("Got "));
emit finished(AccountTaskState::STATE_WORKING, tr("Got MSA token"));
});
connect(&m_oauth2, &QOAuth2AuthorizationCodeFlow::authorizeWithBrowser, this, &MSAStep::authorizeWithBrowser);
connect(&m_oauth2, &QOAuth2AuthorizationCodeFlow::requestFailed, this, [this, silent](const QAbstractOAuth2::Error err) {

View File

@@ -66,5 +66,5 @@ void MinecraftProfileStep::onRequestDone()
return;
}
emit finished(AccountTaskState::STATE_WORKING, tr("Minecraft Java profile acquisition succeeded."));
emit finished(AccountTaskState::STATE_WORKING, tr("Got Minecraft profile"));
}

View File

@@ -115,13 +115,13 @@ bool XboxAuthorizationStep::processSTSError()
switch (errorCode) {
case 2148916233: {
emit finished(AccountTaskState::STATE_FAILED_SOFT,
tr("This Microsoft account does not have an XBox Live profile. Buy the game on %1 first.")
tr("This Microsoft account does not have an Xbox Live profile. Buy the game on %1 first.")
.arg("<a href=\"https://www.minecraft.net/en-us/store/minecraft-java-edition\">minecraft.net</a>"));
return true;
}
case 2148916235: {
// NOTE: this is the Grulovia error
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("XBox Live is not available in your country. You've been blocked."));
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("Xbox Live is not available in your country. You've been blocked."));
return true;
}
case 2148916238: {

View File

@@ -60,7 +60,7 @@ void XboxProfileStep::onRequestDone()
return;
}
qCDebug(authCredentials()) << "XBox profile: " << *m_response;
qCDebug(authCredentials()) << "Xbox profile: " << *m_response;
emit finished(AccountTaskState::STATE_WORKING, tr("Got Xbox profile"));
}

View File

@@ -48,7 +48,7 @@ void XboxUserStep::perform()
connect(m_task.get(), &Task::finished, this, &XboxUserStep::onRequestDone);
m_task->start();
qDebug() << "First layer of XBox auth ... commencing.";
qDebug() << "First layer of Xbox auth ... commencing.";
}
void XboxUserStep::onRequestDone()
@@ -56,9 +56,9 @@ void XboxUserStep::onRequestDone()
if (m_request->error() != QNetworkReply::NoError) {
qWarning() << "Reply error:" << m_request->error();
if (Net::isApplicationError(m_request->error())) {
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("XBox user authentication failed: %1").arg(m_request->errorString()));
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("Xbox user authentication failed: %1").arg(m_request->errorString()));
} else {
emit finished(AccountTaskState::STATE_OFFLINE, tr("XBox user authentication failed: %1").arg(m_request->errorString()));
emit finished(AccountTaskState::STATE_OFFLINE, tr("Xbox user authentication failed: %1").arg(m_request->errorString()));
}
return;
}
@@ -66,7 +66,7 @@ void XboxUserStep::onRequestDone()
Token temp;
if (!Parsers::parseXTokenResponse(*m_response, temp, "UToken")) {
qWarning() << "Could not parse user authentication response...";
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("XBox user authentication response could not be understood."));
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("Xbox user authentication response could not be understood."));
return;
}
m_data->userToken = temp;