Fix Keycloak: scene reload on error, web signal missed, redirect URI
PC — scene reloading on auth error: Auth.gd's keycloak error handler called change_scene_to_file(LoginScreen) after emitting auth_failed, which reloaded the scene and wiped the error message before the user could see it. Removed the scene change — the login screen is already active and handles auth_failed itself. Web — token_received signal never handled after page redirect: login_screen._ready() returned early when Keycloak.auth_in_progress was true, before connecting Keycloak.token_received. When the exchange completed nobody was listening, so the game sat frozen. Signals are now connected before the early-return check. Web — fragile redirect URI and sessionStorage injection: JavaScriptBridge.eval return value could stringify as "<null>". Now uses separate origin + pathname evals with a null check. sessionStorage items and the final navigation use uri_encode() + decodeURIComponent() instead of manual quote-escaping, preventing injection from PKCE values. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -33,6 +33,7 @@ func _ready() -> void:
|
||||
sign_in_btn.pressed.connect(_on_sign_in_pressed)
|
||||
|
||||
# Web export: returning from Keycloak redirect — exchange is already in flight.
|
||||
# Signals are connected above before this check so token_received is handled.
|
||||
if Keycloak.auth_in_progress:
|
||||
_set_status("Completing sign-in…", false)
|
||||
_set_enabled(false)
|
||||
|
||||
Reference in New Issue
Block a user