LiveReactNative.MobileSocket behaviour (live_react_native v0.0.3)
View Sourceuse this in your app's mobile socket and override resolve_user/2 and
build_session/3. The library performs no authentication — you resolve
identity with your existing verifier and gate routes with your existing
live_session/on_mount hooks.
defmodule MyAppWeb.MobileSocket do
use LiveReactNative.MobileSocket
def resolve_user(%{"token" => t}, _info), do: MyApp.Auth.user_from_token(t)
def build_session(user, _params, _info), do: %{"current_user" => user}
endResolve-if-present: a missing/invalid token yields current_user: nil (anonymous);
the socket is not rejected. Per-route gating is your on_mount hooks' job.