0

I have an app which you can log into using facebook. This uses Omniauth and koala which all works nicely in developement ENV.

However, in production mode deployed to a subURI, my action and routes for signing in fails. The deployed URL looks like so and code as follows:

www.domain_name/rails_app

When attempting to log in url goes to

www.domain_name/auth/facebook 

not

www.domain_name/rails_app/auth/facebook

routes.rb

  match 'auth/:provider/callback', to: 'sessions#create' 
  match 'auth/failure', to: redirect('/')
  match 'signout', to: 'sessions#destroy', as: 'signout'

Login action homepage.html.erb

<b><%= link_to "Sign in with Facebook", "/auth/facebook", id: "sign_in" %></b>

I have tried

match 'auth/:provider/callback', to: 'sessions#create', as: "signin"

and using signin_path instead of /auth/facebook but this errors out with missing action in sessions#create.

Is there a way to properly map match 'auth/:provider/callback', to: 'sessions#create' to a path like login_path?`

1 Answer 1

0

try this - write in your production.rb file

DOMAIN_CONFIG = "http://www.domain_name/"  
config.action_mailer.default_url_options = { :host => "http://www.domain_name" }
2
  • Hi Dipak, how come its action mailer? and should it be domain_name.eu/rails_app or just domain_name? Oct 11, 2012 at 10:09
  • hmm that hasn't done anything either unfortunately. Is there a way to map that match 'auth/:provider/callback', to: 'sessions#create' to a proper route path? like login_path? Oct 11, 2012 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.