pow-auth / pow_assent

Multi-provider authentication for your Pow enabled app
https://powauth.com
MIT License
318 stars 50 forks source link

Custom redirect on de-authorization #245

Closed samullen closed 8 months ago

samullen commented 8 months ago

I'm working through an area on my project which allows my customers to manage their authentications: change password, reset password, manage oauth settings, etc. I have most of it working after looking through the docs and code, but I'm struggling to get OAuth de-authorization to redirect back to the preferred path /settings/authentication.

I have links to disconnect which point to /auth/:provider with the delete HTTP method. When clicked, it removes the user_identity correctly, but redirects to /registrations/edit rather than /settings/authentication. Appending a request_path parameter doesn't work, and I've so far not been able to get custom routes to handle it either. What am I missing?

samullen commented 8 months ago

Nevermind. Figured it out by adding the following to my custom Pow.Routes file:

  def registration_path(_conn, :edit) do
    ~p"/settings/authentication"
  end