aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-07-06 21:24:14 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-07-23 12:38:01 +0200
commit2e94562f79d45eb746c54b3ffc9776afdb499096 (patch)
treeb165c53af29cf975f02c4ce7f9feaf5a70fb4838 /launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
parentac8ee9f981ea509c04ce64d70a47429a1207e18e (diff)
downloadPrismLauncher-2e94562f79d45eb746c54b3ffc9776afdb499096.tar.gz
PrismLauncher-2e94562f79d45eb746c54b3ffc9776afdb499096.tar.bz2
PrismLauncher-2e94562f79d45eb746c54b3ffc9776afdb499096.zip
fix: treat accounts as offline, if auth servers are down
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp')
-rw-r--r--launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp b/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
index 589768e3..14bde47e 100644
--- a/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
+++ b/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp
@@ -6,6 +6,7 @@
#include "minecraft/auth/AuthRequest.h"
#include "minecraft/auth/Parsers.h"
+#include "net/NetUtils.h"
XboxAuthorizationStep::XboxAuthorizationStep(AccountData* data, Katabasis::Token *token, QString relyingParty, QString authorizationKind):
AuthStep(data),
@@ -62,10 +63,24 @@ void XboxAuthorizationStep::onRequestDone(
#endif
if (error != QNetworkReply::NoError) {
qWarning() << "Reply error:" << error;
- if(!processSTSError(error, data, headers)) {
+ if (Net::isApplicationError(error)) {
+ if(!processSTSError(error, data, headers)) {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Failed to get authorization for %1 services. Error %2.").arg(m_authorizationKind, error)
+ );
+ }
+ else {
+ emit finished(
+ AccountTaskState::STATE_FAILED_SOFT,
+ tr("Unknown STS error for %1 services: %2").arg(m_authorizationKind, requestor->errorString_)
+ );
+ }
+ }
+ else {
emit finished(
- AccountTaskState::STATE_FAILED_SOFT,
- tr("Failed to get authorization for %1 services. Error %2.").arg(m_authorizationKind, error)
+ AccountTaskState::STATE_OFFLINE,
+ tr("Failed to get authorization for %1 services: %2").arg(m_authorizationKind, requestor->errorString_)
);
}
return;