I would like to load some relationships and calculations on the current_user that is in the assings (
socket.assigns.current_user
socket.assigns.current_user
).
Ive tried replacing the
current_user
current_user
in
auth_controller.ex
auth_controller.ex
in
success()
success()
but the issue is that the token and some other values are not loaded by default and also i felt like the pages started to load slower.
One option I though of was to add a preperation that always loads the values I wanted, but I am not sure if this the "correct" way.
What makes most sense here?
EDIT: also "private" relationships are not loaded since there is a policty to check if the actor is the owner, but the actor is nil on the initial call so the loaded value is nil
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.