From 75fdfea2126c2425859ff57cc56e17daddf1080d Mon Sep 17 00:00:00 2001 From: Jyrki Gadinger Date: Fri, 17 Jan 2025 14:28:11 +0100 Subject: [PATCH] persist credentials retrieved through the wizard 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 --- src/gui/creds/webflowcredentials.cpp | 1 + src/gui/owncloudsetupwizard.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gui/creds/webflowcredentials.cpp b/src/gui/creds/webflowcredentials.cpp index 0495d3b888a2e..bd2eb458eb07c 100644 --- a/src/gui/creds/webflowcredentials.cpp +++ b/src/gui/creds/webflowcredentials.cpp @@ -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; } diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index 58a6d613f0475..6b36e0fe7e478 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -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"));