Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

ruby on rails - Devise, OmniAuth & Facebook: "Not found. Authentication passthru."

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_APP_ID'], ENV['FB_APP_SECRET'] in my config/initializers/devise.rb, devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } in my routes.rb, and an OmniAuthCallbacks controller defined.

When I visit user_omniauth_authorize_path(:facebook), I get: Not found. Authentication passthru. I'm not sure what to do next. I am not using route globing, so I don't believe I need to define a passthru method, but doing so just gives me a 404.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Also make sure you have added a route to the OmniauthCallbacksController:

devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }

and that you have added the update to the devise declaration in your User model:

devise :omniauthable, :omniauth_providers => [:facebook]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...