Skip to content

Commit

Permalink
persist credentials retrieved through the wizard
Browse files Browse the repository at this point in the history
When setting up an account through the wizard for the first time, the
credentials are not saved properly.  This requires the user to sign in
again after an application restart.

At least for the login flow v2 case, the `WebFlowCredentials` class
eventually persists the retrieved credentials, whereas the class used
within the wizard (`OCC::Flow2AuthCredsPage`) doesn't.

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
  • Loading branch information
nilsding authored and mgallien committed Jan 24, 2025
1 parent af2027d commit 75fdfea
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/webflowcredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ bool WebFlowCredentials::stillValid(QNetworkReply *reply) {
void WebFlowCredentials::persist() {
if (_user.isEmpty()) {
// We don't even have a user nothing to see here move along
qCWarning(lcWebFlowCredentials) << "_user is unset, nothing to persist ...";
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/owncloudsetupwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ void OwncloudSetupWizard::slotConnectToOCUrl(const QString &url)
AbstractCredentials *creds = _ocWizard->getCredentials();
if (creds) {
_ocWizard->account()->setCredentials(creds);
creds->persist();
}

const auto fetchUserNameJob = new JsonApiJob(_ocWizard->account()->sharedFromThis(), QStringLiteral("/ocs/v1.php/cloud/user"));
Expand Down

0 comments on commit 75fdfea

Please sign in to comment.