From b3001a4b5b3078c2016f775b360f1d83918ac185 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Feb 2026 01:14:33 -0800 Subject: [PATCH] Fail fast when auth TCP disconnects during authentication --- src/auth/auth_handler.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/auth/auth_handler.cpp b/src/auth/auth_handler.cpp index bd7d428d..f0e3c891 100644 --- a/src/auth/auth_handler.cpp +++ b/src/auth/auth_handler.cpp @@ -433,6 +433,17 @@ void AuthHandler::update(float /*deltaTime*/) { // Update socket (processes incoming data and calls packet callback) socket->update(); + + // If the server drops the TCP connection mid-auth, surface it as an auth failure immediately + // (otherwise the UI just hits its generic timeout). + if (!socket->isConnected()) { + if (state != AuthState::DISCONNECTED && + state != AuthState::FAILED && + state != AuthState::AUTHENTICATED && + state != AuthState::REALM_LIST_RECEIVED) { + fail("Disconnected by auth server"); + } + } } void AuthHandler::setState(AuthState newState) {