From 3efaf7c9463261fb2d182a7ae00d9045a2b273b8 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Tue, 12 May 2026 13:50:45 -0500 Subject: Migrating to OAuth Authentication (#2374) Co-authored-by: aglowinthefield <146008217+aglowinthefield@users.noreply.github.com> Co-authored-by: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> --- src/organizercore.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index dff3485e..68ccd2ff 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -299,11 +299,13 @@ bool OrganizerCore::nexusApi(bool retry) // previous attempt, maybe even successful return false; } else { - QString apiKey; - if (GlobalSettings::nexusApiKey(apiKey)) { + NexusOAuthTokens tokens; + GlobalSettings::nexusOAuthTokens(tokens); + GlobalSettings::nexusApiKey(tokens.apiKey); + if (tokens.isValid() || !tokens.apiKey.isEmpty()) { // credentials stored or user entered them manually - log::debug("attempt to verify nexus api key"); - accessManager->apiCheck(apiKey); + log::debug("attempt to verify nexus credentials"); + accessManager->apiCheck(tokens); return true; } else { // no credentials stored and user didn't enter them @@ -1473,12 +1475,12 @@ void OrganizerCore::loggedInAction(QWidget* parent, std::function f) if (NexusInterface::instance().getAccessManager()->validated()) { f(); } else if (!m_Settings.network().offlineMode()) { - QString apiKey; - if (GlobalSettings::nexusApiKey(apiKey)) { + NexusOAuthTokens tokens; + if (GlobalSettings::nexusOAuthTokens(tokens)) { doAfterLogin([f] { f(); }); - NexusInterface::instance().getAccessManager()->apiCheck(apiKey); + NexusInterface::instance().getAccessManager()->apiCheck(tokens); } else { MessageDialog::showMessage(tr("You need to be logged in with Nexus"), parent); } -- cgit v1.3.1