Question

I'm using Omniauth in my Rails app (which is launched locally using POW). After my providers return to the callback action, I get redirect back in port 19999. I don't want to hard code the port into the redirect_to (e.g.: redirect_to root_url, :port => PORT).

I want either to get the port dynamically or understand why the port is 19999.

If I launch my app normally (rails s -p 3000), the port doesn't change to 19999.

Was it helpful?

Solution

You can setup callback url's host with OmniAuth.config.full_host like:

OmniAuth.config.full_host = "http://yourapp.dev"

This must be placed before omniauth is called. I think config/initializes/omniauth.rb is good.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top