[SOLVED] Facebook-accounts redirect_uri is incorrect localhost:3000

https://www.facebook.com/v3.0/dialog/oauth?client_id=11111111111111111&redirect_uri=http://localhost:4000/_oauth/facebook&display=popup&scope=public_profile,email,pages_manage_ads,pages_manage_metadata,pages_read_engagement,pages_read_user_content,ads_management,ads_read,attribution_read,business_management,read_insights&state=eyJsb2dpblN0eWxlIjoicG9wdXAiLCJjcmVkZW50aWFsVG9rZW4iOiJnS0RDaXduQUNraVo5UnBndGRPRWQyMXd5WkFORUlxTjlhTVJtemNubm5zIiwiaXNDb3Jkb3ZhIjpmYWxzZX0=

redirect_uri=*http://localhost:4000/

This just isn’t correct and it’s reaaaaaly screwing me up. I’ve set the ROOT_URL, I’ve added entries in Facebook app manager – but upon clicking login from Meteor, this is the request sent out.

HELP?!

You need to edit the app settings on Facebook

see: Users and Accounts | Meteor Guide


EDIT: Poking around a bit more, the actual url is built using Meteor.absoluteUrl, which should be using ROOT_URL

The only time it wouldn’t use it is if you pass in options with a different rootUrl to Meteor.loginWithFacebook? Which I assume you’re not doing.

Maybe it’s not picking up your ROOT_URL correctly? Have you logged out process.env.ROOT_URL to check what Meteor is seeing?

1 Like

You’re a genius. Thanks pal. Looks like my settings are not correctly setting the absolute URL, so if I fix that this should work! I’m on Windows which is kinda stupid for setting the environment variable.

Yep! When I run in console the URL is incorrect, but what FB is returning:
image

It should be my dev.mycompany.com

1 Like

Weird, I had to use set ROOT_URL=whatever.com

OUTSIDE of my .bat script then it works. Weird.

But it’s working now, THANKS

1 Like

Hahah come back all this time later to find I found the solution, AGAIN. Thanks ME!

What was your solution? I can’t make it work in development mode. I set ROOT_URL=whatever.com but it’s always localhost:3000