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/settingsdialognexus.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/settingsdialognexus.h') diff --git a/src/settingsdialognexus.h b/src/settingsdialognexus.h index 0c14ebf7..fdc1d292 100644 --- a/src/settingsdialognexus.h +++ b/src/settingsdialognexus.h @@ -1,10 +1,16 @@ #ifndef SETTINGSDIALOGNEXUS_H #define SETTINGSDIALOGNEXUS_H +#include "nexusoauthlogin.h" +#include "nexusoauthtokens.h" #include "nxmaccessmanager.h" #include "settings.h" #include "settingsdialog.h" +#include +#include +class QAbstractButton; +class QListWidget; // used by the settings dialog and the create instance dialog // class NexusConnectionUI : public QObject @@ -32,22 +38,23 @@ private: QAbstractButton* m_manual; QListWidget* m_log; - std::unique_ptr m_nexusLogin; + std::unique_ptr m_nexusLogin; std::unique_ptr m_nexusValidator; + std::optional m_pendingTokens; void addLog(const QString& s); void updateState(); - void validateKey(const QString& key); - bool setKey(const QString& key); - bool clearKey(); + void validateCredentials(const NexusOAuthTokens& tokens); + bool persistTokens(const NexusOAuthTokens& tokens); + bool clearCredentials(); - void onSSOKeyChanged(const QString& key); - void onSSOStateChanged(NexusSSOLogin::States s, const QString& e); + void onTokensReceived(const NexusOAuthTokens& tokens); + void onOAuthStateChanged(NXMAccessManager::OAuthState s, const QString& message); void onValidatorFinished(ValidationAttempt::Result r, const QString& message, - std::optional useR); + std::optional user); }; class NexusSettingsTab : public SettingsTab -- cgit v1.3.1