From 1e2dab3c0ce49efe2b5940c15f47388c69d6731b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 29 Sep 2011 12:28:32 +0200 Subject: [PATCH] Assume status 401 if action finishes without status code and no exception, closes #1316. --- lib/devise/controllers/helpers.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/devise/controllers/helpers.rb b/lib/devise/controllers/helpers.rb index d4590752..8dd60c3a 100644 --- a/lib/devise/controllers/helpers.rb +++ b/lib/devise/controllers/helpers.rb @@ -8,6 +8,13 @@ module Devise helper_method :warden, :signed_in?, :devise_controller? end + module ClassMethods + def log_process_action(payload) + payload[:status] ||= 401 unless payload[:exception] + super + end + end + # Define authentication filters and accessor helpers based on mappings. # These filters should be used inside the controllers as before_filters, # so you can control the scope of the user who should be signed in to