Meteor.js Twitter login when running on the Codio editor "page not available"

161 Views Asked by At

I'm using the online IDE called Codio which comes with internal hosting.

Each Codio project gets assigned a url and a port, for my Meteor project it was http://deliver-milk.codio.io:3000

I tried adding the accounts-twitter package, set up the details, input my API key and secret, but I seem to be having an issue - when I authenticate in the pop-up and the callback redirect action takes place, it throws me a "This webpage is not available" error.

I checked the url of the pop-up and it seems to be trying to navigate to http://localhost:3000/_oauth/twitter?close&state=

In my twitter app settings, I've tried all these as my callbacks, but the end result remains the same:

http://127.0.0.1:3000/_oauth/twitter?close
http://127.0.0.1/_oauth/twitter?close 
http://deliver-milk.codio.io:3000/_oauth/twitter?close
http://deliver-milk.codio.io:3000

..as well as different variations of these

Has anyone faced this issue and has got any ideas how to overcome this?

2

There are 2 best solutions below

1
On

Look to reference the server bindings with 0.0.0.0 rather than 127.0.0.1 or localhost. As its Online based they won't work

0
On

You have to do what ijobling said. It's in your Gruntfile.js file change the line for 0.0.0.0 like this :

        hostname: '0.0.0.0',

Then try again to connect with

http://deliver-milk.codio.io:3000

If it doesn't work check your port or your firewall.