GameServerWeb.PlayLive (game_server_web v1.0.943)

Copy Markdown

LiveView wrapper that embeds the Godot web export (/game/index.html) inside the app layout so the navbar is visible.

The game itself runs in an iframe with its own COOP/COEP headers (set by GameServerWeb.Plugs.GameHeaders) so SharedArrayBuffer works.

When the user is session-authenticated, this LiveView mints a short-lived JWT access-token (and a refresh-token) so the Godot game can call the API. Tokens are delivered in two ways:

  1. URL fragment – the iframe src becomes /game/index.html#access_token=…&refresh_token=… (fragment never leaves the browser).
  2. localStorage – a JS hook writes gamend_access_token and gamend_refresh_token so the game can also read them with JavaScriptBridge.eval("localStorage.getItem('gamend_access_token')").