team-alembic / ash_authentication_phoenix

Drop-in authentication support for Phoenix apps using AshAuthentication.
MIT License
52 stars 23 forks source link

support something similar to how return_to works for regular controllers #450

Open simon-nystrom opened 1 month ago

simon-nystrom commented 1 month ago

When attempting to access an authenticated resource such as one like this:

  ash_authentication_live_session :authentication_required,
    on_mount: {MyApp.LiveUserAuth, :live_user_required} do
    live "/protected", SomeView
  end

You successfully get redirected to the the sign in page, but once you sign in successfully there seems to be no easy way to figure out where you came from, and thus no easy way to redirect back to where your authentication failed

It would be great if there was an easy way to send the user back to where they were redirected from