Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2018-06-13 16:15:54 +0300
committerOlivier Goffart <olivier@woboq.com>2018-06-14 13:58:18 +0300
commit4cc053908080444cb956066c8841151d0fb411a7 (patch)
tree011b5f3ae761c22514f284d6b3c9a5be320af88a /src/gui/accountstate.cpp
parent9bb2f1965db7123d36d3c1c4625a49b8bb5c7695 (diff)
OAuth2: Try to refresh the token even if the credentials weren't ready.
This can happen when the client is started and the internet connection was not enabled. Then we would fetch the credentials, but we would no do the refresh token step (because network is down). So next time we try to connect, we would also not refresh the token because the credentials are not marked as 'ready' Reported in https://github.com/owncloud/client/issues/6522#issuecomment-396845167
Diffstat (limited to 'src/gui/accountstate.cpp')
-rw-r--r--src/gui/accountstate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp
index 2f20c57db..88b03307f 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -314,10 +314,10 @@ void AccountState::slotInvalidCredentials()
if (account()->credentials()->ready()) {
account()->credentials()->invalidateToken();
- if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) {
- if (creds->refreshAccessToken())
- return;
- }
+ }
+ if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) {
+ if (creds->refreshAccessToken())
+ return;
}
account()->credentials()->askFromUser();
}