Skip to content

Commit 1cdcb88

Browse files
committed
Fix #10408
1 parent 19f94d1 commit 1cdcb88

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

changelog/unreleased/10408

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ error occurred during the retrieval of the credentials from the system's keychai
55
The client then required a manual log out and log in.
66

77
https://github.com/owncloud/client/issues/10408
8+
https://github.com/owncloud/client/pull/10505

src/libsync/creds/httpcredentials.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void HttpCredentials::fetchFromKeychainHelper()
204204

205205
auto job = _account->credentialManager()->get(isUsingOAuth() ? refreshTokenKeyC() : passwordKeyC());
206206
connect(job, &CredentialJob::finished, this, [job, this] {
207-
if (job->error() != QKeychain::NoError) {
207+
auto handleError = [job, this] {
208208
qCWarning(lcHttpCredentials) << "Could not retrieve client password from keychain" << job->errorString();
209209

210210
// we come here if the password is empty or any other keychain
@@ -215,6 +215,9 @@ void HttpCredentials::fetchFromKeychainHelper()
215215
_password.clear();
216216
_ready = false;
217217
emit fetched();
218+
};
219+
if (job->error() != QKeychain::NoError) {
220+
handleError();
218221
return;
219222
}
220223
const auto data = job->data().toString();
@@ -228,8 +231,7 @@ void HttpCredentials::fetchFromKeychainHelper()
228231
emit fetched();
229232
}
230233
} else {
231-
Q_EMIT authenticationFailed();
232-
Q_EMIT _account->invalidCredentials();
234+
handleError();
233235
}
234236
});
235237
}

0 commit comments

Comments
 (0)