aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/auth/steps/MSAStep.cpp
diff options
context:
space:
mode:
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: