From 00cdab045288f3b06f3ca15e1d11de7a09a3820f Mon Sep 17 00:00:00 2001 From: architect-bot Date: Thu, 20 Aug 2026 16:40:56 +0000 Subject: [PATCH] WIP checkpoint: Address review feedback: Fix: navigating Play -> Back logs the user out (should stay logged in) --- scripts/main_menu.gd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/main_menu.gd b/scripts/main_menu.gd index 605feee..70dbf8c 100644 --- a/scripts/main_menu.gd +++ b/scripts/main_menu.gd @@ -65,6 +65,12 @@ func _ready() -> void: _play_button = $CenterContainer/VBoxContainer/PlayButton _quit_button = $CenterContainer/VBoxContainer/QuitButton + # Default to Play being gated. When a token exists, the async session + # check below may take several frames (a real get_me() round-trip); + # keeping the button disabled until validation succeeds prevents a fast + # click from navigating to world_list with an expired/invalid token. + _play_button.disabled = true + # Check whether a valid session already exists (e.g. user logged in, # navigated to world_list, then clicked Back). If so, restore the # authenticated UI state instead of forcing the login form again. @@ -85,7 +91,7 @@ func _ready() -> void: ## Restore the UI to the authenticated state (Play enabled, welcome label, ## auth buttons hidden). func _show_authenticated(username: String) -> void: - _auth_panel.visible = false + _auth_panel.visible = true _status_label.visible = false _welcome_label.text = "Welcome, %s!" % username _welcome_label.visible = true