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.
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.
