aboutsummaryrefslogtreecommitdiff
path: root/launcher/dialogs/MSALoginDialog.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2021-08-22 20:01:18 +0200
committerPetr Mrázek <peterix@gmail.com>2021-08-22 20:01:18 +0200
commiteae65da110bb957194b34e0f3573ce4e6e6ddc78 (patch)
tree425a9252338c3db5eac4a5018f594ab646f6cea6 /launcher/dialogs/MSALoginDialog.h
parent50b92c1af2d28ab59a9b70ce0b3dca62bf1a7583 (diff)
downloadPrismLauncher-eae65da110bb957194b34e0f3573ce4e6e6ddc78.tar.gz
PrismLauncher-eae65da110bb957194b34e0f3573ce4e6e6ddc78.tar.bz2
PrismLauncher-eae65da110bb957194b34e0f3573ce4e6e6ddc78.zip
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.
Diffstat (limited to 'launcher/dialogs/MSALoginDialog.h')
-rw-r--r--launcher/dialogs/MSALoginDialog.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/launcher/dialogs/MSALoginDialog.h b/launcher/dialogs/MSALoginDialog.h
index 402180ee..3d26a0dd 100644
--- a/launcher/dialogs/MSALoginDialog.h
+++ b/launcher/dialogs/MSALoginDialog.h
@@ -17,6 +17,7 @@
#include <QtWidgets/QDialog>
#include <QtCore/QEventLoop>
+#include <QTimer>
#include "minecraft/auth/MinecraftAccount.h"
@@ -46,10 +47,17 @@ slots:
void onTaskSucceeded();
void onTaskStatus(const QString &status);
void onTaskProgress(qint64 current, qint64 total);
+ void showVerificationUriAndCode(const QUrl &uri, const QString &code, int expiresIn);
+ void hideVerificationUriAndCode();
+
+ void externalLoginTick();
private:
Ui::MSALoginDialog *ui;
MinecraftAccountPtr m_account;
- std::shared_ptr<Task> m_loginTask;
+ std::shared_ptr<AccountTask> m_loginTask;
+ QTimer m_externalLoginTimer;
+ int m_externalLoginElapsed = 0;
+ int m_externalLoginTimeout = 0;
};