auth: improve status messages (#4750)
This commit is contained in:
@@ -75,7 +75,7 @@ bool getBool(QJsonValue value, bool& out)
|
|||||||
"Message":"",
|
"Message":"",
|
||||||
"Redirect":"https://start.ui.xboxlive.com/AddChildToFamily"
|
"Redirect":"https://start.ui.xboxlive.com/AddChildToFamily"
|
||||||
}
|
}
|
||||||
// 2148916233 = missing XBox account
|
// 2148916233 = missing Xbox account
|
||||||
// 2148916238 = child account not linked to a family
|
// 2148916238 = child account not linked to a family
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ LauncherLoginStep::LauncherLoginStep(AccountData* data) : AuthStep(data) {}
|
|||||||
|
|
||||||
QString LauncherLoginStep::describe()
|
QString LauncherLoginStep::describe()
|
||||||
{
|
{
|
||||||
return tr("Accessing Mojang services.");
|
return tr("Fetching Minecraft access token");
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherLoginStep::perform()
|
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."));
|
emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("Failed to parse the Minecraft access token response."));
|
||||||
return;
|
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.extra = rsp.extra;
|
||||||
m_data->msaToken.refresh_token = rsp.refresh_token;
|
m_data->msaToken.refresh_token = rsp.refresh_token;
|
||||||
m_data->msaToken.token = rsp.access_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.extra = m_oauth2.extraTokens();
|
||||||
m_data->msaToken.refresh_token = m_oauth2.refreshToken();
|
m_data->msaToken.refresh_token = m_oauth2.refreshToken();
|
||||||
m_data->msaToken.token = m_oauth2.token();
|
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::authorizeWithBrowser, this, &MSAStep::authorizeWithBrowser);
|
||||||
connect(&m_oauth2, &QOAuth2AuthorizationCodeFlow::requestFailed, this, [this, silent](const QAbstractOAuth2::Error err) {
|
connect(&m_oauth2, &QOAuth2AuthorizationCodeFlow::requestFailed, this, [this, silent](const QAbstractOAuth2::Error err) {
|
||||||
|
|||||||
@@ -66,5 +66,5 @@ void MinecraftProfileStep::onRequestDone()
|
|||||||
return;
|
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) {
|
switch (errorCode) {
|
||||||
case 2148916233: {
|
case 2148916233: {
|
||||||
emit finished(AccountTaskState::STATE_FAILED_SOFT,
|
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>"));
|
.arg("<a href=\"https://www.minecraft.net/en-us/store/minecraft-java-edition\">minecraft.net</a>"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case 2148916235: {
|
case 2148916235: {
|
||||||
// NOTE: this is the Grulovia error
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
case 2148916238: {
|
case 2148916238: {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void XboxProfileStep::onRequestDone()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qCDebug(authCredentials()) << "XBox profile: " << *m_response;
|
qCDebug(authCredentials()) << "Xbox profile: " << *m_response;
|
||||||
|
|
||||||
emit finished(AccountTaskState::STATE_WORKING, tr("Got Xbox profile"));
|
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);
|
connect(m_task.get(), &Task::finished, this, &XboxUserStep::onRequestDone);
|
||||||
|
|
||||||
m_task->start();
|
m_task->start();
|
||||||
qDebug() << "First layer of XBox auth ... commencing.";
|
qDebug() << "First layer of Xbox auth ... commencing.";
|
||||||
}
|
}
|
||||||
|
|
||||||
void XboxUserStep::onRequestDone()
|
void XboxUserStep::onRequestDone()
|
||||||
@@ -56,9 +56,9 @@ void XboxUserStep::onRequestDone()
|
|||||||
if (m_request->error() != QNetworkReply::NoError) {
|
if (m_request->error() != QNetworkReply::NoError) {
|
||||||
qWarning() << "Reply error:" << m_request->error();
|
qWarning() << "Reply error:" << m_request->error();
|
||||||
if (Net::isApplicationError(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 {
|
} 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;
|
return;
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ void XboxUserStep::onRequestDone()
|
|||||||
Token temp;
|
Token temp;
|
||||||
if (!Parsers::parseXTokenResponse(*m_response, temp, "UToken")) {
|
if (!Parsers::parseXTokenResponse(*m_response, temp, "UToken")) {
|
||||||
qWarning() << "Could not parse user authentication response...";
|
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;
|
return;
|
||||||
}
|
}
|
||||||
m_data->userToken = temp;
|
m_data->userToken = temp;
|
||||||
|
|||||||
Reference in New Issue
Block a user