kav/connect-auth — comment on commit f8d2f7bd45584603b623f083e0612f322458e29d
File:  line 0
By kav:

My redirectUrl is either the value you passed in as the callback url or it's the request.url. This means if you pass something for the callback url the code behaves as it always has. If you didn't however then the user's request url (i.e. request.url) is passed to Facebook as the redirect_url and thus you can wrap any url on your site in a Facebook auth request and know that the user will be returned to the url they originally requested rather than sent to some standard landing page.

I'm not sure my fix is completely perfect, there is a bit more that could be done, for example Facebook sends the request back with a signed request param which could be parsed off and handled before the request is passed to the original url, but it does work pretty well.