1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 11:19:18 +01:00

Fix refresh token issues with Google Drive.

This commit is contained in:
John Maguire 2013-02-26 16:24:47 +01:00
parent b5b371ef6f
commit 160d9edfb6
2 changed files with 5 additions and 2 deletions

View File

@ -49,8 +49,9 @@ void GoogleDriveSettingsPage::Load() {
s.beginGroup(GoogleDriveService::kSettingsGroup);
const QString user_email = s.value("user_email").toString();
const QString refresh_token = s.value("refresh_token").toString();
if (!user_email.isEmpty()) {
if (!user_email.isEmpty() && !refresh_token.isEmpty()) {
ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedIn, user_email);
}
}

View File

@ -161,7 +161,9 @@ void OAuthenticator::RefreshAccessTokenFinished(QNetworkReply* reply) {
QVariantMap result = parser.parse(reply, &ok).toMap();
access_token_ = result["access_token"].toString();
refresh_token_ = result["refresh_token"].toString();
if (result.contains("refresh_token")) {
refresh_token_ = result["refresh_token"].toString();
}
SetExpiryTime(result["expires_in"].toInt());
emit Finished();
}