Hi,
What would be a good way to pass some information from the conn to the LiveView socket ?
Let’s assume the following example
router.ex
scope "/admin", MyAppWeb.Admin do
......
pipe_through :ensure_admin_authenticated
live "/article/:id/edit"
end
In my ensure_admin_authenticated plug I check the current user, see if it is admin and assign it to the conn.
I would like to have that available in the LiveView socket. For example, if I render the LiveView from a controller, I can use the session to pass the user, but I would not want to use controllers if possible.
Thanks






















