Skip to content

Commit

Permalink
OAuth: clear refresh token when the server claim not to support oauth
Browse files Browse the repository at this point in the history
Allow upgrade path when the server removes support for oauth
Relates: #5848 (comment)

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
  • Loading branch information
ogoffart committed Jul 24, 2017
1 parent 848ae95 commit 32c4733
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/creds/httpcredentialsgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ void HttpCredentialsGui::showDialog()
bool ok = dialog.exec();
if (ok) {
_password = dialog.textValue();
_refreshToken.clear();
_ready = true;
persist();
}
Expand Down
1 change: 1 addition & 0 deletions src/libsync/creds/httpcredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 32c4733

Please sign in to comment.