summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2026-05-12 13:50:45 -0500
committerGitHub <noreply@github.com>2026-05-12 13:50:45 -0500
commit3efaf7c9463261fb2d182a7ae00d9045a2b273b8 (patch)
tree8cc2c9f14d8cffe73187cf42ce8141c87bccef32 /src/organizercore.cpp
parent41ffb25c03956d1c6619c284e821611e70bcc307 (diff)
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>
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp16
1 files changed, 9 insertions, 7 deletions
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<void()> 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);
}