Merge pull request #635 from nextcloud/upstream/issue/6522

OAuth2: Try to refresh the token even if the credentials weren't ready.
This commit is contained in:
Roeland Jago Douma 2018-10-23 21:07:04 +02:00 committed by GitHub
commit 4e866123c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}