diff options
-rw-r--r-- | changelog/unreleased/8901 | 6 | ||||
-rw-r--r-- | src/gui/accountstate.cpp | 28 |
2 files changed, 19 insertions, 15 deletions
diff --git a/changelog/unreleased/8901 b/changelog/unreleased/8901 new file mode 100644 index 000000000..9bfcddb93 --- /dev/null +++ b/changelog/unreleased/8901 @@ -0,0 +1,6 @@ +Bugfix: Start oauth/password prompt if password is wrong during start up + +If the oauth token was invalid during start up we didn't start the oauth process +and the user needed to manually log out in order to log in again. + +https://github.com/owncloud/client/issues/8901 diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index d2ae79394..cdab097f7 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -385,23 +385,21 @@ void AccountState::slotConnectionValidatorResult(ConnectionValidator::Status sta void AccountState::slotInvalidCredentials() { - if (isSignedOut() || _waitingForNewCredentials) - return; - - qCInfo(lcAccountState) << "Invalid credentials for" << _account->url().toString() - << "asking user"; + if (!_waitingForNewCredentials) { + qCInfo(lcAccountState) << "Invalid credentials for" << _account->url().toString() + << "asking user"; - _waitingForNewCredentials = true; - setState(AskingCredentials); - - if (account()->credentials()->ready()) { - account()->credentials()->invalidateToken(); - } - if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) { - if (creds->refreshAccessToken()) - return; + _waitingForNewCredentials = true; + if (account()->credentials()->ready()) { + account()->credentials()->invalidateToken(); + } + if (auto creds = qobject_cast<HttpCredentials *>(account()->credentials())) { + if (creds->refreshAccessToken()) + return; + } + account()->credentials()->askFromUser(); } - account()->credentials()->askFromUser(); + setState(AskingCredentials); } void AccountState::slotCredentialsFetched(AbstractCredentials *) |