I use the Devise
to handle the authentications in my app and have public_activity
to record things and have a log. Now I need to add a record to the log when a failed login occurs and when a account gets locked. How can I do this?
You can use Warden's after_authentication
hook as devise is built on warden. Put this in an config/initializers/devise_hooks.rb
:
Warden::Manager.after_authentication do |user, auth, opts|
# do something with user
end
Read details in wardens wiki