diff --git a/server/cloud/cloudauthenticationhandler.h b/server/cloud/cloudauthenticationhandler.h index abf8748e..5bbe89a4 100644 --- a/server/cloud/cloudauthenticationhandler.h +++ b/server/cloud/cloudauthenticationhandler.h @@ -40,7 +40,7 @@ public: CloudErrorNoError, CloudErrorAuthenticationFailed, CloudErrorCloudConnectionDisabled, - CloudErrorIdentyServerNotReachable, + CloudErrorIdentityServerNotReachable, CloudErrorProxyServerNotReachable, CloudErrorLoginCredentialsMissing }; diff --git a/server/cloud/cloudauthenticator.cpp b/server/cloud/cloudauthenticator.cpp index ec8cf911..777201f5 100644 --- a/server/cloud/cloudauthenticator.cpp +++ b/server/cloud/cloudauthenticator.cpp @@ -209,6 +209,14 @@ void CloudAuthenticator::replyFinished(QNetworkReply *reply) QByteArray data = reply->readAll(); m_tokenRequests.removeAll(reply); + if (reply->error() != QNetworkReply::NoError) { + qCWarning(dcCloud()) << "Authenticator: Request token reply error:" << status << reply->errorString(); + m_error = Cloud::CloudErrorIdentityServerNotReachable; + setAuthenticated(false); + reply->deleteLater(); + return; + } + // check HTTP status code if (status != 200) { qCWarning(dcCloud()) << "Authenticator: Request token reply HTTP error:" << status << reply->errorString(); @@ -250,6 +258,14 @@ void CloudAuthenticator::replyFinished(QNetworkReply *reply) QByteArray data = reply->readAll(); m_refreshTokenRequests.removeAll(reply); + if (reply->error() != QNetworkReply::NoError) { + qCWarning(dcCloud()) << "Authenticator: Request token reply error:" << status << reply->errorString(); + m_error = Cloud::CloudErrorIdentityServerNotReachable; + setAuthenticated(false); + reply->deleteLater(); + return; + } + // check HTTP status code if (status != 200) { qCWarning(dcCloud()) << "Authenticator: Refresh token reply HTTP error:" << status << reply->errorString(); diff --git a/tests/auto/api.json b/tests/auto/api.json index 0f9adae6..6399051d 100644 --- a/tests/auto/api.json +++ b/tests/auto/api.json @@ -590,7 +590,7 @@ "CloudErrorNoError", "CloudErrorAuthenticationFailed", "CloudErrorCloudConnectionDisabled", - "CloudErrorIdentyServerNotReachable", + "CloudErrorIdentityServerNotReachable", "CloudErrorProxyServerNotReachable", "CloudErrorLoginCredentialsMissing" ],