redirect from oauth callback
I am currently using google oauth sign on but I want to enable return to functionality.
case conn.params["returnto"] do
"/" <> = return_to -> redirect(conn, to: returnto)
-> redirect(conn, to: ~p"/")
end
For example a user is on a page and presses a button that triggers functionality that requires a logged in user. They redirected to the login page and they sign in with Google. I want them to be sent back to the page they were on originally. I have this set up with the password strat using query params but I can't see a way to do it with the Google sign in due to the fact we have the redirect URI hardcoded, any suggestions welcome.
4 Replies
I believe there are PRs up for this in AshAuthentication or AshAuthenticationhoenix, or issues describing how to do it
please search around and see if you can find them
Amazing found it I looked in ash auth not ash auth phx always forget about that lib thanks
adding this here for others: https://github.com/team-alembic/ash_authentication_phoenix/issues/584
https://github.com/team-alembic/ash_authentication_phoenix/issues/581
GitHub
add ReturnTo Plug · Issue #584 · team-alembic/ashauthentication...
The installer creates an AuthController that will redirect the user based on :return_to in the session but doesn't supply a means to capture and set the :return_to value. Create a plug somethin...
GitHub
Idea: setting a
return_to
URI to return to following a successful...I was trying to use ash_authentication, ash_authentication_phoenix, and beacon in such a way that I could put the Beacon Admin functionality behind an Ash authentication. The desired behaviour I wa...
solution