aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/auth/steps/MSAStep.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-08-04 19:42:36 +0200
committerGitHub <noreply@github.com>2023-08-04 19:42:36 +0200
commitae793f6cf11658c9abc5111e82d5ba7b3e6af127 (patch)
treeed41f30e2c0f02e4be1d42324b3f05fbab75b2cd /launcher/minecraft/auth/steps/MSAStep.cpp
parent50c7d39e082f0a7dbd977401e16d5adf534d9770 (diff)
parent1d638e018ac40fbfb35dd117f9a948c0cf35eadd (diff)
downloadPrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.gz
PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.bz2
PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.zip
Merge pull request #1459 from Scrumplex/format
Diffstat (limited to 'launcher/minecraft/auth/steps/MSAStep.cpp')
-rw-r--r--launcher/minecraft/auth/steps/MSAStep.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/launcher/minecraft/auth/steps/MSAStep.cpp b/launcher/minecraft/auth/steps/MSAStep.cpp
index 6fc8d468..1aa22765 100644
--- a/launcher/minecraft/auth/steps/MSAStep.cpp
+++ b/launcher/minecraft/auth/steps/MSAStep.cpp
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
- * PolyMC - Minecraft Launcher
+ * Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
@@ -47,7 +47,8 @@
using OAuth2 = Katabasis::DeviceFlow;
using Activity = Katabasis::Activity;
-MSAStep::MSAStep(AccountData* data, Action action) : AuthStep(data), m_action(action) {
+MSAStep::MSAStep(AccountData* data, Action action) : AuthStep(data), m_action(action)
+{
m_clientId = APPLICATION->getMSAClientID();
OAuth2::Options opts;
opts.scope = "XboxLive.signin offline_access";
@@ -64,13 +65,14 @@ MSAStep::MSAStep(AccountData* data, Action action) : AuthStep(data), m_action(ac
MSAStep::~MSAStep() noexcept = default;
-QString MSAStep::describe() {
+QString MSAStep::describe()
+{
return tr("Logging in with Microsoft account.");
}
-
-void MSAStep::rehydrate() {
- switch(m_action) {
+void MSAStep::rehydrate()
+{
+ switch (m_action) {
case Refresh: {
// TODO: check the tokens and see if they are old (older than a day)
return;
@@ -82,12 +84,14 @@ void MSAStep::rehydrate() {
}
}
-void MSAStep::perform() {
- switch(m_action) {
+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."));
+ emit finished(AccountTaskState::STATE_DISABLED,
+ tr("Microsoft user authentication failed - client identification has changed."));
}
m_oauth2->refresh();
return;
@@ -105,8 +109,9 @@ void MSAStep::perform() {
}
}
-void MSAStep::onOAuthActivityChanged(Katabasis::Activity activity) {
- switch(activity) {
+void MSAStep::onOAuthActivityChanged(Katabasis::Activity activity)
+{
+ switch (activity) {
case Katabasis::Activity::Idle:
case Katabasis::Activity::LoggingIn:
case Katabasis::Activity::Refreshing: