diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2022-03-24 13:17:03 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2022-03-24 14:01:02 +0300 |
commit | 7fa1f562499c49fea602ac4ea20bf4c032e1d022 (patch) | |
tree | 7b4e9f553a155f5b4bfefa91f027130e8896010a | |
parent | 0a78f713ca14f8ac702f513694c3f1cdd3c463c8 (diff) |
Fix basic auth logout
Fixes: #9545
-rw-r--r-- | changelog/unreleased/9545 | 5 | ||||
-rw-r--r-- | src/gui/accountstate.cpp | 4 | ||||
-rw-r--r-- | src/gui/creds/httpcredentialsgui.cpp | 2 | ||||
-rw-r--r-- | src/libsync/creds/abstractcredentials.h | 7 |
4 files changed, 18 insertions, 0 deletions
diff --git a/changelog/unreleased/9545 b/changelog/unreleased/9545 new file mode 100644 index 000000000..e7c3835f9 --- /dev/null +++ b/changelog/unreleased/9545 @@ -0,0 +1,5 @@ +Bugfix: Can't stop basic auth login + +We fixed a bug where the user was asked for their credentials again and again with no chance to abort. + +https://github.com/owncloud/client/issues/9545 diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index b04181a97..608d386d3 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -115,6 +115,10 @@ AccountState::AccountState(AccountPtr account) checkConnectivity(false); }, Qt::QueuedConnection); + + connect(account->credentials(), &AbstractCredentials::requestLogout, this, [this] { + _state = State::SignedOut; + }); } AccountState::~AccountState() diff --git a/src/gui/creds/httpcredentialsgui.cpp b/src/gui/creds/httpcredentialsgui.cpp index e035f1a09..3bf9d896b 100644 --- a/src/gui/creds/httpcredentialsgui.cpp +++ b/src/gui/creds/httpcredentialsgui.cpp @@ -151,6 +151,8 @@ void HttpCredentialsGui::showDialog() _refreshToken.clear(); _ready = true; persist(); + } else { + Q_EMIT requestLogout(); } emit asked(); }); diff --git a/src/libsync/creds/abstractcredentials.h b/src/libsync/creds/abstractcredentials.h index 8326f5d69..7218c10ed 100644 --- a/src/libsync/creds/abstractcredentials.h +++ b/src/libsync/creds/abstractcredentials.h @@ -106,6 +106,13 @@ Q_SIGNALS: void authenticationStarted(); void authenticationFailed(); + /* + * Request to log out. + * The connected account should be marked as logged out + * and no automatic tries to connect should be made. + */ + void requestLogout(); + protected: Account *_account; bool _wasFetched; |