lib/devise-security/hooks/expirable.rb in devise-security-0.12.0 vs lib/devise-security/hooks/expirable.rb in devise-security-0.13.0
- old
+ new
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
# 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_activity!)
record.update_last_activity!
end
-end
\ No newline at end of file
+end