aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'launcher')
-rw-r--r--launcher/CMakeLists.txt4
-rw-r--r--launcher/minecraft/auth/flows/AuthContext.cpp12
-rw-r--r--launcher/pages/global/AccountListPage.cpp9
3 files changed, 12 insertions, 13 deletions
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index 7241b89d..c29ee3e1 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -949,9 +949,7 @@ install(TARGETS MultiMC
RUNTIME DESTINATION ${BINARY_DEST_DIR} COMPONENT Runtime
)
-if(MultiMC_EMBED_SECRETS)
- target_link_libraries(MultiMC_logic secrets)
-endif()
+target_link_libraries(MultiMC_logic secrets)
#### The MultiMC bundle mess! ####
# Bundle utilities are used to complete the portable packages - they add all the libraries that would otherwise be missing on the target system.
diff --git a/launcher/minecraft/auth/flows/AuthContext.cpp b/launcher/minecraft/auth/flows/AuthContext.cpp
index 776f45fe..b4db6c2d 100644
--- a/launcher/minecraft/auth/flows/AuthContext.cpp
+++ b/launcher/minecraft/auth/flows/AuthContext.cpp
@@ -18,9 +18,7 @@
#include "katabasis/Globals.h"
#include "AuthRequest.h"
-#ifdef EMBED_SECRETS
#include "Secrets.h"
-#endif
#include "Env.h"
@@ -53,13 +51,18 @@ void AuthContext::finishActivity() {
}
void AuthContext::initMSA() {
-#ifdef EMBED_SECRETS
if(m_oauth2) {
return;
}
+
+ auto clientId = Secrets::getMSAClientID('-');
+ if(clientId.isEmpty()) {
+ return;
+ }
+
Katabasis::OAuth2::Options opts;
opts.scope = "XboxLive.signin offline_access";
- opts.clientIdentifier = Secrets::getMSAClientID('-');
+ opts.clientIdentifier = clientId;
opts.authorizationUrl = "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode";
opts.accessTokenUrl = "https://login.microsoftonline.com/consumers/oauth2/v2.0/token";
opts.listenerPorts = {28562, 28563, 28564, 28565, 28566};
@@ -71,7 +74,6 @@ void AuthContext::initMSA() {
connect(m_oauth2, &OAuth2::linkingSucceeded, this, &AuthContext::onOAuthLinkingSucceeded);
connect(m_oauth2, &OAuth2::showVerificationUriAndCode, this, &AuthContext::showVerificationUriAndCode);
connect(m_oauth2, &OAuth2::activityChanged, this, &AuthContext::onOAuthActivityChanged);
-#endif
}
void AuthContext::initMojang() {
diff --git a/launcher/pages/global/AccountListPage.cpp b/launcher/pages/global/AccountListPage.cpp
index 6bb07b22..f52fa834 100644
--- a/launcher/pages/global/AccountListPage.cpp
+++ b/launcher/pages/global/AccountListPage.cpp
@@ -37,6 +37,8 @@
#include "BuildConfig.h"
#include <dialogs/MSALoginDialog.h>
+#include "Secrets.h"
+
AccountListPage::AccountListPage(QWidget *parent)
: QMainWindow(parent), ui(new Ui::AccountListPage)
{
@@ -70,11 +72,8 @@ AccountListPage::AccountListPage(QWidget *parent)
updateButtonStates();
- // Xbox authentication won't work without a client identifier, so disable the button
- // if the build didn't specify one (GH-4012)
-#ifndef EMBED_SECRETS
- ui->actionAddMicrosoft->setVisible(false);
-#endif
+ // Xbox authentication won't work without a client identifier, so disable the button if it is missing
+ ui->actionAddMicrosoft->setVisible(Secrets::hasMSAClientID());
}
AccountListPage::~AccountListPage()