I'm using facebook authentication on my site, with the "Login with Facebook" button in my nav menu on every page. Therefore the user should be able to login via facebook and be returned to the page they were on with one click. Facebook provides the return_uri parameter, which is set to /login/facebook on my site and it handles all of the authentication against the facebook API. However, once I am done with this logic and I log the user in, I need to know what page they were on originally so I can redirect them.
I've tried passing my return_uri parameter as:
http://example.com/login/facebook?local_redir=http://example.com/users/original/page
(with everything question mark and after encoded properly of course) so when I get the response back I know what their original page was. This fails when I try to get the access token. I basically need a way to have a "pass-through" parameter to facebook, but am coming up short here.