Connection Refused

I am building a mobile app for Android using Ionic + Angular and I implement an OAuth2 workflow.

When the authentication endpoint redirects back to my app, the navigation is blocked showing the following message:

Application Error
net::ERR_CONNECTION_REFUSED(http://localhost/home?code=)

When serving my app with livereload it works fine, probably because a port is added to the url.