diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-30 15:23:39 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-30 15:23:39 +0200 |
commit | 999ec716d5e2b03aceb562e730edf3939eb2578a (patch) | |
tree | 5bf36271007081f17d2f05809784a445a1df6f60 /lib | |
parent | e31d1bfcc9255f2e6ad4dbd54bd49429939e8e78 (diff) | |
download | libquotient-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.cpp | 9 |
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(); |