开发者

Log incident when an account is locked after three failed attempts with Devise

开发者 https://www.devze.com 2023-03-05 10:19 出处:网络
I want to log in the database the incident when a users account is locked. I\'m using Rails3 and Devise, so I think I\'ll need to override some action in a Devise controller, I just don\'t know which

I want to log in the database the incident when a users account is locked. I'm using Rails3 and Devise, so I think I'll need to override some action in a Devise controller, I just don't know which controller/action an开发者_如何学JAVAd how to capture the users Id. Any tips?


I know this is an old question, but the easiest approach is probably to override lock_access! from the lockable mixin (in your user model):

def lock_access!
  super
  # record an account lock here
end
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号