aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-30 15:23:39 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-30 15:23:39 +0200
commit999ec716d5e2b03aceb562e730edf3939eb2578a (patch)
tree5bf36271007081f17d2f05809784a445a1df6f60 /lib
parente31d1bfcc9255f2e6ad4dbd54bd49429939e8e78 (diff)
downloadlibquotient-999ec716d5e2b03aceb562e730edf3939eb2578a.tar.gz
libquotient-999ec716d5e2b03aceb562e730edf3939eb2578a.zip
Emit loggedOut() after the access token is gone
...not before.
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 7e36b3c9..b7f49546 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -398,7 +398,7 @@ public:
//TODO error handling
}
- void removeAccessTokenFromKeychain()
+ void dropAccessToken()
{
qCDebug(MAIN) << "Removing access token from keychain for" << q->userId();
auto job = new QKeychain::DeletePasswordJob(qAppName());
@@ -411,6 +411,8 @@ public:
pickleJob->setKey(q->userId() + "-Pickle"_ls);
pickleJob->start();
//TODO error handling
+
+ data->setToken({});
}
};
@@ -727,10 +729,9 @@ void Connection::logout()
|| d->logoutJob->error() == BaseJob::ContentAccessError) {
if (d->syncLoopConnection)
disconnect(d->syncLoopConnection);
- d->data->setToken({});
- emit loggedOut();
SettingsGroup("Accounts").remove(userId());
- d->removeAccessTokenFromKeychain();
+ d->dropAccessToken();
+ emit loggedOut();
deleteLater();
} else { // logout() somehow didn't proceed - restore the session state
emit stateChanged();