fix: restore full Godot auth in progressive web build

This commit is contained in:
2026-08-01 21:50:22 +08:00
parent 7a07f52e2c
commit 52c5a76a01
5 changed files with 102 additions and 220 deletions

View File

@@ -696,6 +696,7 @@ func _ready() -> void:
_connect_signals()
_refresh_appearance_ui()
_show_login()
_notify_web_shell_ready()
if _auth_manager != null and bool(_auth_manager.call("is_authenticated")) and _should_auto_resume_cached_session():
_resume_cached_session()
@@ -741,6 +742,12 @@ func _connect_signals() -> void:
if _auth_manager.has_signal("browser_bootstrap_received"):
_auth_manager.connect("browser_bootstrap_received", _complete_browser_bootstrap)
func _notify_web_shell_ready() -> void:
if OS.get_name() != "Web" or not Engine.has_singleton("JavaScriptBridge"):
return
var bridge: Object = Engine.get_singleton("JavaScriptBridge")
bridge.eval("window.whaletownGodotReady && window.whaletownGodotReady()", true)
func _complete_browser_bootstrap(kind: String) -> void:
if _is_submitting:
return