aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/connection.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 5ed72616..fa358e17 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -321,11 +321,14 @@ void Connection::checkAndConnect(const QString& userId,
void Connection::logout()
{
auto job = callApi<LogoutJob>();
- connect( job, &LogoutJob::success, this, [this] {
- stopSync();
- d->data->setToken({});
- emit stateChanged();
- emit loggedOut();
+ connect( job, &LogoutJob::finished, this, [job,this] {
+ if (job->status().good() || job->error() == BaseJob::ContentAccessError)
+ {
+ stopSync();
+ d->data->setToken({});
+ emit stateChanged();
+ emit loggedOut();
+ }
});
}