diff options
author | flow <thiagodonato300@gmail.com> | 2022-02-23 14:34:51 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 14:34:51 -0300 |
commit | 38f12c50f773ed7ec54bc8ea11691352aef81aee (patch) | |
tree | a68ceb5e334a3725d970a283e99d5c6e8e48f570 /launcher/minecraft/auth/steps | |
parent | f8b0d6453ae81488ddfd4c83b329e2c88787c49e (diff) | |
parent | 9e35560554eb089370ba487e5b6265b4bd8e739a (diff) | |
download | PrismLauncher-38f12c50f773ed7ec54bc8ea11691352aef81aee.tar.gz PrismLauncher-38f12c50f773ed7ec54bc8ea11691352aef81aee.tar.bz2 PrismLauncher-38f12c50f773ed7ec54bc8ea11691352aef81aee.zip |
Merge branch 'PolyMC:develop' into develop
Diffstat (limited to 'launcher/minecraft/auth/steps')
-rw-r--r-- | launcher/minecraft/auth/steps/MSAStep.cpp | 8 | ||||
-rw-r--r-- | launcher/minecraft/auth/steps/MSAStep.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/launcher/minecraft/auth/steps/MSAStep.cpp b/launcher/minecraft/auth/steps/MSAStep.cpp index 779aee43..207d9373 100644 --- a/launcher/minecraft/auth/steps/MSAStep.cpp +++ b/launcher/minecraft/auth/steps/MSAStep.cpp @@ -12,9 +12,10 @@ using OAuth2 = Katabasis::DeviceFlow; using Activity = Katabasis::Activity; MSAStep::MSAStep(AccountData* data, Action action) : AuthStep(data), m_action(action) { + m_clientId = APPLICATION->getMSAClientID(); OAuth2::Options opts; opts.scope = "XboxLive.signin offline_access"; - opts.clientIdentifier = APPLICATION->getMSAClientID(); + opts.clientIdentifier = m_clientId; opts.authorizationUrl = "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode"; opts.accessTokenUrl = "https://login.microsoftonline.com/consumers/oauth2/v2.0/token"; @@ -48,6 +49,10 @@ void MSAStep::rehydrate() { void MSAStep::perform() { switch(m_action) { case Refresh: { + if (m_data->msaClientID != m_clientId) { + emit hideVerificationUriAndCode(); + emit finished(AccountTaskState::STATE_DISABLED, tr("Microsoft user authentication failed - client identification has changed.")); + } m_oauth2->refresh(); return; } @@ -57,6 +62,7 @@ void MSAStep::perform() { m_oauth2->setExtraRequestParams(extraOpts); *m_data = AccountData(); + m_data->msaClientID = m_clientId; m_oauth2->login(); return; } diff --git a/launcher/minecraft/auth/steps/MSAStep.h b/launcher/minecraft/auth/steps/MSAStep.h index 49ba3542..301e1465 100644 --- a/launcher/minecraft/auth/steps/MSAStep.h +++ b/launcher/minecraft/auth/steps/MSAStep.h @@ -29,4 +29,5 @@ private slots: private: Katabasis::DeviceFlow *m_oauth2 = nullptr; Action m_action; + QString m_clientId; }; |