Skip to content

Commit 4cc0539

Browse files
committedJun 14, 2018
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 #6522 (comment)
1 parent 9bb2f19 commit 4cc0539

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/gui/accountstate.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ void AccountState::slotInvalidCredentials()
314314

315315
if (account()->credentials()->ready()) {
316316
account()->credentials()->invalidateToken();
317-
if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) {
318-
if (creds->refreshAccessToken())
319-
return;
320-
}
317+
}
318+
if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) {
319+
if (creds->refreshAccessToken())
320+
return;
321321
}
322322
account()->credentials()->askFromUser();
323323
}

0 commit comments

Comments
 (0)
Please sign in to comment.