【问题标题】:Routing Error for [GET] "/auth/facebook"[GET] "/auth/facebook" 的路由错误
【发布时间】:2014-06-21 21:07:29
【问题描述】:

我正在使用 deviseomniauth gems 进行身份验证。我遵循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
    }

【问题讨论】:

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


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-15
      相关资源
      最近更新 更多