Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise + Facebook + Omniauth callback stuck

I'm using Devise + Rails 3. These are the gems I'm using:

gem 'devise' (1.3.4)
gem 'mm-devise' (1.2)
gem 'omniauth-facebook' (1.3.0)
gem 'omniauth' (1.1.0)
gem 'oauth2' (0.6.1)
gem 'oa-core' (0.3.2)

I followed the setup tutorial on devise/omniauth wiki.

My routes:

devise_for :users
resources :events
resources :posts
resources :users
root :to => "home#index"

devise_scope :user do
  get "sign_in", :to => "devise/sessions#new"
end

devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

Facebook redirects me to:

http://localhost:3000/users/auth/facebook/callback. 

I see the request being stuck in Pending mode on the browser. The server log shows:

(facebook) Callback phase initiated.

but never passes this phase. I set up the callback as suggested in the tutorial:

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController

  def facebook
    ...
  end

  def passthru
    ...
  end
end

What am I missing?

Any help will be appreciated.

Thanks a lot!

like image 754
Ariel T Avatar asked Jun 13 '12 08:06

Ariel T


1 Answers

Have you tried checking if there was a failure

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController

  def failure
    debugger
    ...
  end
end
like image 179
Adriana Diakite Avatar answered Nov 03 '22 20:11

Adriana Diakite