Current user in Phoenix LiveView

There’s a very good reason for this limitation: Data passed to liveviews will be serialized, put in the html and sent back by the client to start the liveview process via the websocket connection. Therefore you want to keep the data in there as minimal as possible. For authentication usually the user id is enough. In mount you can then fetch the actual user struct.

With assign_new you also have the option to pull already loaded data (e.g. by some plug) out of conn.assigns for the static render happening in the initial http request.