0
我使用omniauth-facebook 1.4.1與設計登錄Facebook。有的Facebook登錄與設計
Could not authorize you from Facebook because "Csrf detected".
錯誤似乎人們通過降級解決這個問題omniauth Facebook的到1.4.0。我嘗試過,但現在有錯誤
The action 'facebook' could not be found for Devise::OmniauthCallbacksController.
我有途徑
devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks}
和omniauth_callbacks是在控制器目錄:
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
# You need to implement the method below in your model
@user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user)
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
sign_in_and_redirect @user, :event => :authentication
else
session["devise.facebook_data"] = env["omniauth.auth"]
redirect_to new_user_registration_url
end
end
end
有什麼建議?