Ryan Bates が素晴らしいスクリーンキャストhttp://railscasts.com/episodes/360-facebook-authenticationで「omniauth-facebook」gem の使い方を説明しています。しかし、次のような問題があります。
#application_controller.rb
private
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
helper_method :current_user
@current_user を設定すると、コントローラーのアクションに対する標準の Devise 認証保護には遅すぎます。
before_filter :authenticate_user!, :except => [:index, :show]
そのため、サインインページにリダイレクトされます.@current_userはビューで利用できます...
多分誰かがそれを修正する方法を知っていますか?
PSリダイレクトハンドラーでいくつかのトリックを見ましたが、より良い決定が必要だと思います...