From 3501f964b5996ed2fc11fba24dd930437a1a713a Mon Sep 17 00:00:00 2001 From: Black Hat Date: Fri, 5 Jul 2019 21:44:37 +0800 Subject: [PATCH] Logout if access token is invalid. --- src/controller.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controller.cpp b/src/controller.cpp index 4f0d0765e..0de2106a5 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -72,7 +72,7 @@ void Controller::loginWithCredentials(QString serverAddr, Connection* conn = new Connection(this); if (serverUrl.isValid()) { - conn->setHomeserver(serverUrl); + conn->setHomeserver(serverUrl); } conn->connectToServer(user, pass, deviceName, ""); connect(conn, &Connection::connected, [=] { @@ -168,6 +168,7 @@ void Controller::invokeLogin() { }); connect(c, &Connection::loginError, [=](QString error, QString) { emit errorOccured("Login Failed", error); + logout(c); }); connect(c, &Connection::networkError, [=](QString error, QString, int, int) {