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

github.com/nextcloud/desktop.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
committerCamila San <hello@camila.codes>2018-09-09 13:00:59 +0300
commita68c95522dc1bdb508ddb2f8e3e48c0eeba105c2 (patch)
tree036afad656215ae82080c6e8eaac4f90c649bc65 /src/gui/accountstate.cpp
parentcb69944b5c09a26f86ec38d7ce9a589cac950f7a (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 50a4f617d..05e7dbb53 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -335,10 +335,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();
}