1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/hooks/trackable.rb

10 lines
465 B
Ruby
Raw Normal View History

# After each sign in, update sign in time, sign in count and sign in IP.
# This is only triggered when the user is explicitly set (with set_user)
# and on authentication. Retrieving the user from session (:fetch) does
# not trigger it.
2010-01-13 17:45:02 +01:00
Warden::Manager.after_set_user :except => :fetch do |record, warden, options|
if record.respond_to?(:update_tracked_fields!) && warden.authenticated?(options[:scope])
2010-03-03 12:03:09 +01:00
record.update_tracked_fields!(warden.request)
end
end