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/flows/AuthFlow.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/flows/AuthFlow.h')
-rw-r--r-- | launcher/minecraft/auth/flows/AuthFlow.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/launcher/minecraft/auth/flows/AuthFlow.h b/launcher/minecraft/auth/flows/AuthFlow.h new file mode 100644 index 00000000..e067cc99 --- /dev/null +++ b/launcher/minecraft/auth/flows/AuthFlow.h @@ -0,0 +1,45 @@ +#pragma once + +#include <QObject> +#include <QList> +#include <QVector> +#include <QSet> +#include <QNetworkReply> +#include <QImage> + +#include <katabasis/DeviceFlow.h> + +#include "minecraft/auth/Yggdrasil.h" +#include "minecraft/auth/AccountData.h" +#include "minecraft/auth/AccountTask.h" +#include "minecraft/auth/AuthStep.h" + +class AuthFlow : public AccountTask +{ + Q_OBJECT + +public: + explicit AuthFlow(AccountData * data, QObject *parent = 0); + + Katabasis::Validity validity() { + return m_data->validity_; + }; + + QString getStateMessage() const override; + + void executeTask() override; + +signals: + void activityChanged(Katabasis::Activity activity); + +private slots: + void stepFinished(AccountTaskState resultingState, QString message); + +protected: + void succeed(); + void nextStep(); + +protected: + QList<AuthStep::Ptr> m_steps; + AuthStep::Ptr m_currentStep; +}; |