[GET]“/ auth / facebook”的路由错误

时间:2014-06-21 21:07:29

标签: ruby-on-rails devise omniauth rails-routing

我正在使用deviseomniauth个宝石进行身份验证。我已经按照this教程,但我有facebookgoogle_oauth2作为提供者。同样的错误是google_oauth2

user.rb

devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :omniauth_providers => [:facebook, :google_oauth2]

devise.rb

  config.omniauth :facebook, ENV["FB_KEY"], ENV["FB_SECRET"], {
    :image_size => 'large'
    }

  config.omniauth :google_oauth2, ENV["GPLUS_KEY"], ENV["GPLUS_SECRET"], {
      :image_aspect_ratio => "square",
      :image_size => 200
    }

1 个答案:

答案 0 :(得分:0)

您可以通过gem使用标准的omniauth策略:

https://github.com/mkdynamic/omniauth-facebook

最好的方法是遵循gem说明:

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