From 156ab805f2b33bce162353786677d00876af2db8 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 8 Jul 2024 18:48:08 +0200 Subject: [PATCH] fix authentication using provider page and web page login flow Signed-off-by: Matthieu Gallien --- src/gui/owncloudsetupwizard.cpp | 4 +++- src/gui/wizard/welcomepage.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index 5eae50e44aae7..c60fd118ff93e 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -333,7 +333,9 @@ void OwncloudSetupWizard::slotConnectToOCUrl(const QString &url) { qCInfo(lcWizard) << "Connect to url: " << url; AbstractCredentials *creds = _ocWizard->getCredentials(); - _ocWizard->account()->setCredentials(creds); + if (creds) { + _ocWizard->account()->setCredentials(creds); + } const auto fetchUserNameJob = new JsonApiJob(_ocWizard->account()->sharedFromThis(), QStringLiteral("/ocs/v1.php/cloud/user")); connect(fetchUserNameJob, &JsonApiJob::jsonReceived, this, [this, url](const QJsonDocument &json, int statusCode) { diff --git a/src/gui/wizard/welcomepage.cpp b/src/gui/wizard/welcomepage.cpp index 3c5dc4a9f1f96..1228f51599d87 100644 --- a/src/gui/wizard/welcomepage.cpp +++ b/src/gui/wizard/welcomepage.cpp @@ -96,7 +96,7 @@ void WelcomePage::setupCreateAccountButton() connect(_ui->createAccountButton, &QPushButton::clicked, this, [this](bool /*checked*/) { _ocWizard->setRegistration(true); _nextPage = WizardCommon::Page_WebView; - _ocWizard->next(); + _ocWizard->setAuthType(OCC::DetermineAuthTypeJob::WebViewFlow); }); #else // WITH_WEBENGINE connect(_ui->createAccountButton, &QPushButton::clicked, this, [this](bool /*checked*/) {