From 95ba2a10ad1eb493949cbcba5dd6c4880519f748 Mon Sep 17 00:00:00 2001
From: Camotoy <20743703+Camotoy@users.noreply.github.com>
Date: Wed, 8 Sep 2021 10:13:46 -0400
Subject: [PATCH] Properly error if Microsoft authentication sends an error
---
connector/pom.xml | 2 +-
.../org/geysermc/connector/network/session/GeyserSession.java | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/connector/pom.xml b/connector/pom.xml
index 81c9acdf8..e6bb897dd 100644
--- a/connector/pom.xml
+++ b/connector/pom.xml
@@ -143,7 +143,7 @@
com.github.GeyserMC
MCAuthLib
- 0e48a094f2
+ 6c99331
compile
diff --git a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java
index bfa9af7cf..9a9b06393 100644
--- a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java
+++ b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java
@@ -658,7 +658,8 @@ public class GeyserSession implements CommandSender {
connectDownstream();
} catch (RequestException e) {
if (!(e instanceof AuthPendingException)) {
- throw new RuntimeException("Failed to log in with Microsoft code!", e);
+ connector.getLogger().error("Failed to log in with Microsoft code!", e);
+ disconnect(e.toString());
} else {
// Wait one second before trying again
connector.getGeneralThreadPool().schedule(() -> attemptCodeAuthentication(msaAuthenticationService), 1, TimeUnit.SECONDS);