使用自定义故障类实现,以设计检测用户是否未确认的触发器是什么?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