Accounts: How to configure the redirect URI which Meteor calls?

I’d like to test a social login under real-life conditions, i.e. without using “localhost”, but instead using a domain under ngrok.io. I configured the redirect URI in Facebook, so the ngrok subdomain is accepted there. But Meteor always rells OAuth to redirect to localhost:3000, if I run my dev server locally. Is it possible to overrride this and let Meteor redirect to another domain?

Have you tried setting the ROOT_URL environment variable?

ROOT_URL=someurl meteor

I’ve not tested this (no FB account), but maybe worth trying.

1 Like

Ah, thanks, I was looking for this option. Will try it!

Unfortunately, this didn’t work. Still localhost:3000 is set as the redirect URI.

:disappointed: Oh well. At least it’s added to the sum total of human knowledge.

1 Like

Try setting up the ROOT_URL in your client like this:

 	Meteor.startup(function () {
	  // Client startup method.
	  Meteor.absoluteUrl.defaultOptions.rootUrl = 'http://xxx.ngrok.io';
	});

This works for me, let me know how it works out for you.

1 Like

This works! Nice! Now if only my service was a lot faster… :wink:

@t3db0t Fantastic! Now am stuck struggling to make it work with my Google Oauth more details. Any ideas are appreciated.

Thank you very much:grinning: