From c1b998534faf66b751f62d9cb44e3e873ce3d03a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 5 Feb 2026 18:18:15 -0800 Subject: [PATCH] Use auth username for world connection --- include/auth/auth_handler.hpp | 1 + src/core/application.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/auth/auth_handler.hpp b/include/auth/auth_handler.hpp index 2317488a..7143d18f 100644 --- a/include/auth/auth_handler.hpp +++ b/include/auth/auth_handler.hpp @@ -52,6 +52,7 @@ public: // State AuthState getState() const { return state; } const std::vector& getSessionKey() const { return sessionKey; } + const std::string& getUsername() const { return username; } // Callbacks void setOnSuccess(AuthSuccessCallback callback) { onSuccess = callback; } diff --git a/src/core/application.cpp b/src/core/application.cpp index 0b456c1b..3992e7cd 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -559,7 +559,11 @@ void Application::setupUICallbacks() { // Connect to world server const auto& sessionKey = authHandler->getSessionKey(); - const std::string accountName = "TESTACCOUNT"; // TODO: Store from auth + std::string accountName = authHandler->getUsername(); + if (accountName.empty()) { + LOG_WARNING("Auth username missing; falling back to TESTACCOUNT"); + accountName = "TESTACCOUNT"; + } if (gameHandler->connect(host, port, sessionKey, accountName)) { LOG_INFO("Connected to world server, transitioning to character selection");