riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 21 forks source link

Flash message missing on successful password change #35

Closed mudphone closed 7 years ago

mudphone commented 7 years ago

I noticed that the success flash message is missing after a successful password change. I believe this is due to the configure_session(conn, drop: true) on line: https://github.com/riverrun/phauxth/blob/master/installer/new/templates/password_reset_controller.ex#L45

Is this because drop: true causes the response to drop the Phoenix flash messages? I did some testing with IEx.pry, and the flash message is still in the conn when the controller action exits. So, perhaps this is happening after.

In any case, I was able to get the flash message to show up by adding the renew: true option to configure_session/2 (https://hexdocs.pm/plug/1.4.3/Plug.Conn.html#configure_session/2). This apparently "generates a new session id for the cookie." So, I'm not sure this is what everyone wants. But, I am using it to get the message to show.

If this is something you'd like a PR for, I'd be happy to assist.

riverrun commented 7 years ago

Thanks for reporting this. I'll look into it over the next few days.

riverrun commented 7 years ago

This is fixed in version 1.1.3.

I replaced configure_session(drop: true) with delete_session(conn, :user_id). This removes the current user session but preserves the flash message.