Authentication error
Gives this error (attached)
Solution:Jump to solution
Like usually i would set
current_user: user on my conn but it appears ash is doing something different6 Replies
Yeah you're missing a case. This code only accounts for the happy path, but the moment someone fails to authenticate there's nothing to handle that.
I replaced it with this:
but idk how to pull the user off of the conn
Solution
Like usually i would set
current_user: user on my conn but it appears ash is doing something different
this is not demure
Ehm, maybe something like
Map.get(socket.assigns, :current_user)?
or is not a liveview? sorry, this is all mostly greek to me yet but this is how I do it@Gonzalo Muñoz in the test the given snippet assigns it to a session using a token. We need to call
retrieve_from_session/2 to fetch the user and assign it to the conn