OAuth: clear refresh token when the server claim not to support oauth

Allow upgrade path when the server removes support for oauth
Relates: https://github.com/owncloud/client/issues/5848#issuecomment-317353049

We also need to force the account to commit the config to the disk,
otherwise we may not register we are no longer using owncloud and we
risk sending the password as the token to the token refresh API call
This commit is contained in:
Olivier Goffart 2017-07-24 12:00:29 +02:00 committed by Olivier Goffart
parent c043840cb1
commit 6ae88514d8
2 changed files with 2 additions and 0 deletions

View file

@ -120,6 +120,7 @@ void HttpCredentialsGui::showDialog()
bool ok = dialog.exec();
if (ok) {
_password = dialog.textValue();
_refreshToken.clear();
_ready = true;
persist();
}

View file

@ -397,6 +397,7 @@ void HttpCredentials::persist()
_account->setCredentialSetting(QLatin1String(userC), _user);
_account->setCredentialSetting(QLatin1String(isOAuthC), isUsingOAuth());
_account->wantsAccountSaved(_account);
// write cert
WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());