summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <[email protected]>2015-05-21 15:10:11 +0200
committerMartin Klapetek <[email protected]>2015-05-21 15:10:11 +0200
commit9c5062d82064b7933edc2678dc6e46e591f7c291 (patch)
tree5954b0289eaeb9f5c078e6f69adb3685f463d23f
parentda5d00ecb4073c777ba2a5f985762a1bb21bc4e2 (diff)
Handle Tp::SASLStatusServerFailed in Google auth operationaccountStorageInterface
-rw-r--r--x-telepathy-sso-google-operation.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/x-telepathy-sso-google-operation.cpp b/x-telepathy-sso-google-operation.cpp
index 1f6b7e6..2821659 100644
--- a/x-telepathy-sso-google-operation.cpp
+++ b/x-telepathy-sso-google-operation.cpp
@@ -24,6 +24,7 @@
#include <KSharedConfig>
#include <KConfigGroup>
+#include <KLocalizedString>
XTelepathySSOGoogleOperation::XTelepathySSOGoogleOperation(const Tp::AccountPtr &account, int accountStorageId, Tp::Client::ChannelInterfaceSASLAuthenticationInterface *saslIface)
: PendingOperation(account)
@@ -53,6 +54,13 @@ void XTelepathySSOGoogleOperation::onSASLStatusChanged(uint status, const QStrin
qDebug() << "Authentication succeeded";
setFinished();
break;
+ case Tp::SASLStatusServerFailed:
+ qDebug() << "Auth failed";
+ QString errorMessage = details[QLatin1String("server-message")].toString();
+ if (errorMessage.isEmpty()) {
+ errorMessage = details[QLatin1String("debug-message")].toString();
+ }
+ setFinishedWithError(reason, errorMessage.isEmpty() ? i18n("Authentication error") : errorMessage);
}
}