diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-12-04 01:18:05 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-12-04 01:18:05 +0100 |
commit | 3c46d8a412956a759f61ae802c540ef72d00b35d (patch) | |
tree | f16564ba6be96b68ba5257a982c144320fff7911 /launcher/minecraft/auth/steps/MSAStep.h | |
parent | ffcef673de9fe848a92d23e02a2abed8df16eb9f (diff) | |
download | PrismLauncher-3c46d8a412956a759f61ae802c540ef72d00b35d.tar.gz PrismLauncher-3c46d8a412956a759f61ae802c540ef72d00b35d.tar.bz2 PrismLauncher-3c46d8a412956a759f61ae802c540ef72d00b35d.zip |
GH-4071 Heavily refactor and rearchitect account system
This makes the account system much more modular
and makes it treat errors as something recoverable,
unless they come directly from the MSA refresh token
becoming invalid.
Diffstat (limited to 'launcher/minecraft/auth/steps/MSAStep.h')
-rw-r--r-- | launcher/minecraft/auth/steps/MSAStep.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/launcher/minecraft/auth/steps/MSAStep.h b/launcher/minecraft/auth/steps/MSAStep.h new file mode 100644 index 00000000..49ba3542 --- /dev/null +++ b/launcher/minecraft/auth/steps/MSAStep.h @@ -0,0 +1,32 @@ + +#pragma once +#include <QObject> + +#include "QObjectPtr.h" +#include "minecraft/auth/AuthStep.h" + +#include <katabasis/DeviceFlow.h> + +class MSAStep : public AuthStep { + Q_OBJECT +public: + enum Action { + Refresh, + Login + }; +public: + explicit MSAStep(AccountData *data, Action action); + virtual ~MSAStep() noexcept; + + void perform() override; + void rehydrate() override; + + QString describe() override; + +private slots: + void onOAuthActivityChanged(Katabasis::Activity activity); + +private: + Katabasis::DeviceFlow *m_oauth2 = nullptr; + Action m_action; +}; |