Sha256: 3aee4b5c251a8c7fb78af479b59ebd9b333465c7e64347f1c646a154d10a6499

Contents?: true

Size: 572 Bytes

Versions: 3

Compression:

Stored size: 572 Bytes

Contents

# Updates the last_activity_at fields from the record. Only when the user is active 
# for authentication and authenticated.
# An expiry of the account is only checked on sign in OR on manually setting the 
# expired_at to the past (see Devise::Models::Expirable for this)
Warden::Manager.after_set_user do |record, warden, options|
  if record && record.respond_to?(:active_for_authentication?) && record.active_for_authentication? && 
      warden.authenticated?(options[:scope]) && record.respond_to?(:update_last_activitiy!)
    record.update_last_activitiy!
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devise_security_extension-0.6.2 lib/devise_security_extension/hooks/expirable.rb
devise_security_extension-0.6.1 lib/devise_security_extension/hooks/expirable.rb
devise_security_extension-0.6.0 lib/devise_security_extension/hooks/expirable.rb