Ngrok, pow and dev lead to redirection to local url after login in Rails 4

I am running ngrok

, pow

and using devise

Rails 4.2.1 to authenticate in my application. When I run it locally by going to http://myapp.dev , pow works fine across the board. I can log in, view pages, etc.

When I set up the ngrok proxy, I get the first login page (by clicking http://123.ngrok.io ) and I can see that it hits my local application. However, after logging in, I am redirected from http://123.ngrok.io to http://myapp.dev and prompted to login again. My "after_sign_in_path" is set to return the path in my application and it works when I do it locally.

Any ideas where this interaction is failing?

+3


source to share


1 answer


You can set the hostname so that no redirection is done in default_url_options



class ApplicationController < ActionController::Base
...
  def default_url_options
    { host: 'hostname.com' }
  end
...
end

      

+1


source







All Articles