forked from xiangwang25/whale-town-front-v2
fix: restore full Godot auth in progressive web build
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user