Facebook login with multiple domains

Hi there,

anyone can share a snippet on how to use Meteor.loginWithFacebook when a single app runs on multiple domains?
The CHANGELOG of the facebook-oauth package hints that it’s possible but it’s not very helpful:

  • Supports params and absoluteUrlOptions as options and pass along to OAuth._redirectUri , this is important to authenticate using Facebook using different domains in the same server.
  • Supports a new way to call the token from Facebook using a URL that is different from the ROOT_URL. With overrideRootUrlFromStateRedirectUrl as true in the settings ( packages.facebook-oauth.overrideRootUrlFromStateRedirectUrl ) we are going to use the redirect URL provided in the initial call. So the redirect URL will be used again in the server to get the token, this information will come from the state. This is important to authenticate using Facebook using different domains in the same server.

If I set overrideRootUrlFromStateRedirectUrl to true, oauth_server.js throws an error. It seems the ROOT_URL is still used for the oauth flow instead of the URL extracted from redirectUrl.

(oauth_server.js:405) Error in OAuth Server: redirectUrl (https://XXX.eu.ngrok.io/_oauth/facebook) is not on the same host as the app (http://localhost:3000/)

If I pass absoluteUrlOptions: { rootUrl: `${window.location.origin}/` } to Meteor.loginWithFacebook, I get the same result.