diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2026-05-12 13:50:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-12 13:50:45 -0500 |
| commit | 3efaf7c9463261fb2d182a7ae00d9045a2b273b8 (patch) | |
| tree | 8cc2c9f14d8cffe73187cf42ce8141c87bccef32 /src/settingsdialognexus.h | |
| parent | 41ffb25c03956d1c6619c284e821611e70bcc307 (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/settingsdialognexus.h')
| -rw-r--r-- | src/settingsdialognexus.h | 21 |
1 files changed, 14 insertions, 7 deletions
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 <memory> +#include <optional> +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<NexusSSOLogin> m_nexusLogin; + std::unique_ptr<NexusOAuthLogin> m_nexusLogin; std::unique_ptr<NexusKeyValidator> m_nexusValidator; + std::optional<NexusOAuthTokens> 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<APIUserAccount> useR); + std::optional<APIUserAccount> user); }; class NexusSettingsTab : public SettingsTab |
