diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2018-10-05 20:45:43 +0300 |
---|---|---|
committer | Olivier Goffart <olivier@woboq.com> | 2018-10-12 13:11:53 +0300 |
commit | 47c7f3f92141ca756fba955a69905682030b2a97 (patch) | |
tree | fc8f60fdb56c232748aaf01b100221a5fa033f49 /src/gui/creds | |
parent | 6cb57cf43907bd11756543ca6aed6d24eca4eae1 (diff) |
OAuth2: Store 'Account::davUser' in the config, and use that user for connecting
We need to use the user id to check if we are connected to the right account.
These might be different from the HTTP Basic Auth login. (LDAP setups)
When the account was configured as an oauth2 account form the wisard, the
http_user was already set correctly to the user id. But when the server is
upgrading from basic auth to oauth2, we need to pick the right login.
Note that Account::davUser() already defaults to the HTTP user when none
is set, so this means the upgrade will be fine if this is not set in the
config.
Issues:
https://github.com/owncloud/oauth2/issues/109
https://github.com/owncloud/enterprise/issues/2781
Diffstat (limited to 'src/gui/creds')
-rw-r--r-- | src/gui/creds/httpcredentialsgui.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/creds/httpcredentialsgui.cpp b/src/gui/creds/httpcredentialsgui.cpp index 3c25c886a..f6f2a9f53 100644 --- a/src/gui/creds/httpcredentialsgui.cpp +++ b/src/gui/creds/httpcredentialsgui.cpp @@ -48,7 +48,7 @@ void HttpCredentialsGui::askFromUserAsync() QObject::connect(job, &DetermineAuthTypeJob::authType, this, [this](DetermineAuthTypeJob::AuthType type) { if (type == DetermineAuthTypeJob::OAuth) { _asyncAuth.reset(new OAuth(_account, this)); - _asyncAuth->_expectedUser = _user; + _asyncAuth->_expectedUser = _account->davUser(); connect(_asyncAuth.data(), &OAuth::result, this, &HttpCredentialsGui::asyncAuthResult); connect(_asyncAuth.data(), &OAuth::destroyed, |