Closed lukashambsch closed 4 years ago
Of course 15 minutes after finally creating an issue I figure it out. The fetch_current_user
plug wasn't added to my router. I modified quite a bit to get things going with my current app, so I'm not sure if it was ever added by the generator.
Before I explain my issue I will mention that I'm using
{:phoenix, "~> 1.5.2"}
and phoenix_live_view.I'm seeing some strange behavior while trying to integrate this into an existing app. The 'creates account and logs the user in' test is failing for the second request in the user registrations controller. The second request in the 'logs the user in' test is also failing in the user sessions controller.
I noticed that the
require_authenticated_user
function is checkingconn.assigns[:current_user]
, butlogin_user
doesn't assign it. Where does that assign happen? In the meantime I've added the assign in tologin_user
.Here's what I'm seeing for the second request in the user registration test after adding that
assign
:The first inspect has
current_user
in the map, but the second one doesn't. I'm having trouble tracking down where it could've been removed.