smpallen99 / coherence

Coherence is a full featured, configurable authentication system for Phoenix
MIT License
1.27k stars 224 forks source link

redirect after user model update? #412

Open ringofhealth opened 5 years ago

ringofhealth commented 5 years ago

the default action after a user updates any field goes to /registration show page. Which is pretty inflexible. I tried to add password_update override in redirect.ex to catch when a user update the password and send them somewhere else.

This currently doesn't work. it always return /registrations after an update.

def password_update(conn, _) do
     redirect(conn, to: dashboard_path(conn, :index))
  end

Edit: After looking at the source code, redirect.ex file has a callback function named registration_update/3, that can be overriden to do custom stuff. This was no in the documentation. Maybe it can be added?

This can be closed now.