我有我的类 Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController 并且我覆盖了 after_omniauth_failure_path_for 方法:
protected
def after_omniauth_failure_path_for resource
'/report_failure'
end
但超级的是被调用的那个。
我怀疑这是因为 passthru 解决方法:
devise_for :users do
get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
end
有谁知道如何克服这个问题?我正在使用设计 2.0.4
这是日志文件报告:
Started GET "/users/auth/facebook/callback?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request." for 77.124.184.115 at 2012-04-19 11:34:46 +0000
Processing by Devise::OmniauthCallbacksController#failure as HTML
Parameters: {"error_reason"=>"user_denied", "error"=>"access_denied", "error_description"=>"The user denied your request."}
Redirected to http://myapp.com/users/sign_in
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
编辑:如果我删除了直通重定向,那么它可以工作:
# def devise_for :users do
# get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
# end
谢谢