加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 没有路由匹配“/ oauth / authorize”

发布时间:2020-12-17 02:42:28 所属栏目:百科 来源:网络整理
导读:我已经开始将Omniauth 1.0集成到我的Rails / Authlogic应用程序中,当我尝试访问localhost:3000 / auth / facebook时出现路由错误. 我们是否应该为我们想要的每个/ auth /策略创建一个自定义路由,或者这里有其他错误吗? # gemfilegem 'omniauth-facebook'#
我已经开始将Omniauth 1.0集成到我的Rails / Authlogic应用程序中,当我尝试访问localhost:3000 / auth / facebook时出现路由错误.

我们是否应该为我们想要的每个/ auth /策略创建一个自定义路由,或者这里有其他错误吗?

# gemfile
gem 'omniauth-facebook'

# routes
resources :authentications
match '/auth/:provider/callback' => 'authentications#create'

# config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook,'20...','bc...'
end

# accessing /auth/facebook
No route matches "/oauth/authorize"

解决方法

更新了我的GemFile

gem "omniauth-facebook",:git => "git://github.com/mkdynamic/omniauth-facebook.git"

它起作用了.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读