auth: improve status messages (#4750)
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user