【发布时间】:2013-06-03 04:00:45
【问题描述】:
实现了自定义失败类,以设计检测用户是否未确认的触发器是什么? warden_message 不起作用。有谁知道吗?
class CustomFailure < Devise::FailureApp
def redirect_url
if warden_options[:scope] == :user
new_user_registration_path
else
new_user_registration_path
end
end
def respond
if http_auth?
http_auth
else
store_location!
flash[:alert] = i18n_message unless flash[:notice]
if warden_message == :unconfirmed
redirect_to "/confirm"
else
redirect_to sign_in_path
end
end
end
end
【问题讨论】:
-
所以?问题是什么?你得到一个错误还是什么?
-
@phoet 它不再重定向,确认路径永远不会路由到
-
你做了什么调试?
标签: ruby-on-rails ruby-on-rails-3 devise