diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-05-21 16:28:05 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-05-26 17:43:25 +0300 |
commit | 7b793a444841fb318004ea6061410657e2825517 (patch) | |
tree | 4d546d6b138e4b827c726ac61e7eb89e585f356f /src/gui | |
parent | 81c78fd0db506c5a38b6ae84976d36ec5bffbb0d (diff) |
Ensure cookies are cleared right before the server check
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/accountstate.cpp | 6 | ||||
-rw-r--r-- | src/gui/connectionvalidator.cpp | 1 | ||||
-rw-r--r-- | src/gui/connectionvalidator.h | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 05f92dfa6..46b89d810 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -21,6 +21,7 @@ #include "logger.h" #include "configfile.h" #include "settingsdialog.h" +#include "theme.h" #include <QMessageBox> #include <QSettings> @@ -262,7 +263,6 @@ void AccountState::checkConnectivity(bool verifyServerState) } if (verifyServerState) { - _account->clearCookieJar(); _queueGuard.block(); } ConnectionValidator *conValidator = new ConnectionValidator(account()); @@ -273,6 +273,10 @@ void AccountState::checkConnectivity(bool verifyServerState) // Use a small authed propfind as a minimal ping when we're // already connected. if (verifyServerState) { + if (Theme::instance()->connectionValidatorClearCookies()) { + // clear the cookies directly before we try to validate + connect(conValidator, &ConnectionValidator::aboutToStart, _account.get(), &Account::clearCookieJar, Qt::DirectConnection); + } conValidator->checkServer(); } else { conValidator->checkServerAndUpdate(); diff --git a/src/gui/connectionvalidator.cpp b/src/gui/connectionvalidator.cpp index d44117cad..e9e0754c6 100644 --- a/src/gui/connectionvalidator.cpp +++ b/src/gui/connectionvalidator.cpp @@ -96,6 +96,7 @@ void ConnectionValidator::slotCheckServerAndAuth() _errors.append(tr("timeout")); reportResult(Timeout); }); + Q_EMIT aboutToStart(); checkJob->start(); } diff --git a/src/gui/connectionvalidator.h b/src/gui/connectionvalidator.h index 27eb09a43..41847245e 100644 --- a/src/gui/connectionvalidator.h +++ b/src/gui/connectionvalidator.h @@ -106,6 +106,10 @@ public slots: void systemProxyLookupDone(const QNetworkProxy &proxy); signals: + /** + * Emited before the actual validation starts + */ + void aboutToStart(); void connectionResult(ConnectionValidator::Status status, const QStringList &errors); protected slots: |