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
ZachDaniel
ZachDaniel5mo ago
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
ajst7les
ajst7lesOP5mo ago
Amazing found it I looked in ash auth not ash auth phx always forget about that lib thanks
ajst7les
ajst7lesOP5mo ago
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&#39;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...
ajst7les
ajst7lesOP5mo ago
solution

Did you find this page helpful?