phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

SessionController create route unreachable for LiveView-based update password flow

Open jsmestad opened this issue 3 years ago • 1 comments

Background

I could be wrong about this, but I have walked the code several times and this does appear to be a logic error. I am doing this in an existing app, so I could be doing something wrong 🤞

Environment

  • Elixir version (elixir -v): 1.14.0-rc.1
  • Phoenix version (mix deps): 1.18.0-dev
  • Operating system: macOS

Expected behavior

Ability to invoke this clause def create(conn, %{"_action" => "password_updated"} = params) in SessionController when logged in so complete the Change Password flow provided by phx.gen.auth.

Actual behavior

This generated test fails do to hitting the redirect guarding the route here.

If I move the post "/users/log_in", UserSessionController, :create outside of the :require_if_user_is_authenticated plug, the test passes as written.

jsmestad avatar Aug 28 '22 19:08 jsmestad