2009-11-24 15:18:42 -02:00
|
|
|
# After each sign in, update sign in time, sign in count and sign in IP.
|
2010-03-31 21:43:19 +02:00
|
|
|
# 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|
|
2010-03-31 21:43:19 +02:00
|
|
|
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)
|
2009-11-24 15:18:42 -02:00
|
|
|
end
|
|
|
|
end
|