add liveview helpers

This commit is contained in:
2021-09-02 23:32:53 -04:00
committed by oliviasculley
parent 81a250206e
commit 66cc11e9eb
8 changed files with 71 additions and 8 deletions

View File

@ -45,7 +45,7 @@ let socket = new Socket("/socket", {params: {token: window.userToken}})
// # max_age: 1209600 is equivalent to two weeks in seconds
// case Phoenix.Token.verify(socket, "user socket", token, max_age: 1209600) do
// {:ok, user_id} ->
// {:ok, assign(socket, :user, user_id)}
// {:ok, socket |> assign(:user, user_id)}
// {:error, reason} ->
// :error
// end