Devise, OmniAuth & Facebook: “Not found. Authentication passthru.”

前端 未结 9 1170
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-16 16:59

Trying to follow along with https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview and I\'m stumped.

I\'ve got config.omniauth :facebook, ENV[\'FB_AP

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 17:22

    So I've stumbeled upon this after opening a old project and and after seeing that my authorize url looke something like "user/auth/facebook.facebook" i ran a rake routes and solved it by changing

    <%= link_to "Sign in with Facebook", user_omniauth_authorize_path(:facebook) %>
    

    to

    <%= link_to "Sign in with Facebook", user_facebook_omniauth_authorize_path %>
    

    Apparently the helpers for the omniauth routes have changed since the rake routes command returned:

    user_facebook_omniauth_authorize   GET|POST   /users/auth/facebook(.:format)          omniauth_callbacks#passthru
    

    and not as it was some months ago when I started the project.

    user_omniauth_authorize            GET|POST   /users/auth/facebook(:provider)          omniauth_callbacks#passthru
    

    Hope this post helps someone.

提交回复
热议问题