diff --git a/lib/devise.rb b/lib/devise.rb index 94d6fce7..5efd1fc2 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -47,7 +47,7 @@ module Devise # Time interval to timeout the user session without activity. mattr_accessor :timeout - @@timeout = 10.minutes + @@timeout = 30.minutes # Used to define the password encryption algorithm. mattr_accessor :encryptor diff --git a/lib/devise/hooks/timeoutable.rb b/lib/devise/hooks/timeoutable.rb index 019e6be0..924cb241 100644 --- a/lib/devise/hooks/timeoutable.rb +++ b/lib/devise/hooks/timeoutable.rb @@ -4,7 +4,7 @@ # record is set, we set the last request time inside it's scoped session to # verify timeout in the following request. Warden::Manager.after_set_user do |record, warden, options| - if record.present? && record.respond_to?(:timeout?) + if record && record.respond_to?(:timeout?) scope = options[:scope] # Record may have already been logged out by another hook (ie confirmable). if warden.authenticated?(scope)