diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-04-16 16:22:54 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-04-24 10:40:43 +0900 |
commit | 1103c1fa00d99c4e090f76fd07a384032f79f0c1 (patch) | |
tree | e6ec8f7aff20f294bc1b175698009a3f0c003f24 | |
parent | 8a3bb2d5b27824890482fa7185bbc1fcda9dd49c (diff) | |
download | libquotient-1103c1fa00d99c4e090f76fd07a384032f79f0c1.tar.gz libquotient-1103c1fa00d99c4e090f76fd07a384032f79f0c1.zip |
Connection::logout: ignore ContentAccessError
Closes #316.
-rw-r--r-- | lib/connection.cpp | 13 |
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(); + } }); } |