GH-3392 Switch MS account login to use device flow instead

Device flow involves the user manually opening a web page and putting in
a code. We no longer need to interact with the browser.
This commit is contained in:
Petr Mrázek
2021-08-22 20:01:18 +02:00
parent 50b92c1af2
commit eae65da110
8 changed files with 96 additions and 42 deletions

View File

@ -36,8 +36,7 @@ private slots:
// OAuth-specific callbacks
void onOAuthLinkingSucceeded();
void onOAuthLinkingFailed();
void onOpenBrowser(const QUrl &url);
void onCloseBrowser();
void onOAuthActivityChanged(Katabasis::Activity activity);
// Yggdrasil specific callbacks
@ -82,13 +81,16 @@ protected:
bool m_xboxProfileSucceeded = false;
bool m_mcAuthSucceeded = false;
Katabasis::Activity m_activity = Katabasis::Activity::Idle;
enum class MSAStage {
Idle,
enum class AuthStage {
Initial,
UserAuth,
XboxAuth,
MinecraftProfile,
Skin
} m_stage = MSAStage::Idle;
Skin,
Complete
} m_stage = AuthStage::Initial;
void setStage(AuthStage stage);
QNetworkAccessManager *mgr = nullptr;
};