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.
This commit is contained in:
parent
ffcef673de
commit
3c46d8a412
68 changed files with 2105 additions and 1446 deletions
33
launcher/minecraft/auth/AuthStep.h
Normal file
33
launcher/minecraft/auth/AuthStep.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#include "QObjectPtr.h"
|
||||
#include "minecraft/auth/AccountData.h"
|
||||
#include "AccountTask.h"
|
||||
|
||||
class AuthStep : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
using Ptr = shared_qobject_ptr<AuthStep>;
|
||||
|
||||
public:
|
||||
explicit AuthStep(AccountData *data);
|
||||
virtual ~AuthStep() noexcept;
|
||||
|
||||
virtual QString describe() = 0;
|
||||
|
||||
public slots:
|
||||
virtual void perform() = 0;
|
||||
virtual void rehydrate() = 0;
|
||||
|
||||
signals:
|
||||
void finished(AccountTaskState resultingState, QString message);
|
||||
void showVerificationUriAndCode(const QUrl &uri, const QString &code, int expiresIn);
|
||||
void hideVerificationUriAndCode();
|
||||
|
||||
protected:
|
||||
AccountData *m_data;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue