diff --git a/GPClient/gatewayauthenticator.cpp b/GPClient/gatewayauthenticator.cpp index eb71c33..222af78 100644 --- a/GPClient/gatewayauthenticator.cpp +++ b/GPClient/gatewayauthenticator.cpp @@ -44,8 +44,9 @@ void GatewayAuthenticator::login(const LoginParams ¶ms) void GatewayAuthenticator::onLoginFinished() { QNetworkReply *reply = qobject_cast(sender()); + QByteArray response; - if (reply->error()) { + if (reply->error() || (response = reply->readAll()).contains("Authentication failure")) { PLOGE << QString("Failed to login the gateway at %1, %2").arg(loginUrl).arg(reply->errorString()); if (normalLoginWindow) { @@ -61,7 +62,7 @@ void GatewayAuthenticator::onLoginFinished() normalLoginWindow->close(); } - const QUrlQuery params = gpclient::helper::parseGatewayResponse(reply->readAll()); + const QUrlQuery params = gpclient::helper::parseGatewayResponse(response); emit success(params.toString()); }