plataformatec/devise — Issue #1568: Problem with Devise + omniauth-facebook with relative url root
Author: mruokojo
Created: 2012-01-13 20:55:31+00:00
State: open

I'm having problems with combination devise and omniauth-facebook and relative url root: links are created without relative root and it breaks the facebook login that way.

With rails 3.1.3 and setting RAILS_RELATIVE_URL_ROOT environment worked fine until I tried this combination. The problem seems to be in routes, see below. All except omniauth callbacks are with "app" relative root.

new_user_session GET /app/users/login(.:format) {:action=>"new", :controller=>"devise/sessions"}
user_session POST /app/users/login(.:format) {:action=>"create", :controller=>"devise/sessions"}
destroy_user_session DELETE /app/users/logout(.:format) {:action=>"destroy", :controller=>"devise/sessions"}
user_omniauth_callback /users/auth/:action/callback(.:format) {:action=>/facebook/, :controller=>"users/omniauth_callbacks"}
user_password POST /app/users/password(.:format) {:action=>"create", :controller=>"devise/passwords"}

Used gems and versions are: rails 3.1.3, devise 1.5.3, omniauth-facebook 1.2.0, omniauth-oauth2 1.0.0, omniauth 1.0.1.

How to fix routes or what I'm missing here? I followed the wiki docs about how to include facebook and omniauth to devise.