开发者

Omniauth/Devise/Facebook: Auth route is not recognized

I've been working on this problem for 7 hours now, and I still have no idea. Maybe one of you can help me.

I'm simply trying to integrate the OAuth feature of Devise 1.2rc, which uses Omniauth, into my Rails application.

  • I've been using this tutorial by Devise:

https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview

  • I have done everything they tell you to...

  • Yes, I have added the following line to my devise.rb:

config.omniauth :facebook, "APP ID", "APP SECRET"

  • I have added :omniauthable to my user model, as well as the class function as described in the tutorial

  • I have implemented the omniauth_callbacks controller, as well as the callback function, and I have specified the omniauth_callbacks controller in my routes.rb

  • When I run "rake middleware" it does list the Omniauth middleware:

use OmniAuth::Strategies::Facebook

  • I have installe开发者_运维百科d Devise directly from the Git repo, master branch, so it's up-to-date

  • I have installed Omniauth 1.2.0.beta5, which is the latest version. In my Gemfile it says:

gem 'oa-oauth', '0.2.0.beta5', :require => 'omniauth/oauth'

  • I have restarted the server, obviously

  • However, when I try to request this URL:

http://localhost:3000/auth/facebook

it simply says

ActionController::RoutingError (No route matches "/auth/facebook"):

/user/auth/facebook doesn't work either.

Since I unfortunately don't have the time to take apart the entire Omniauth and Devise gems and understand every line of code in them, maybe one of you could tell me what the problem might be.


Problem is solved now. Apparently it was a problem with Devise. I posted it as an issue on their Github and they fixed it in their source. In the latest Devise master branch it now works.


After some hours trying to fix this issue I realized that i'd config/initializers/omniauth.rb in the .gitignore file (shame on me).

so remove omniauth.rb from the .gitignore list if you haven't already

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜