Let me post what I have done first:
config.lock_strategy = :failed_attempt
config.unlock_keys = [ :email ]
config.unlock_strategy = :both
config.maximum_attempts = 10
config.unlock_in = 30.minutes
I have added all the fields in the respective table and added: lockable in model as well.
The problem I am facing is, my account is getting locked upon 10 bad attempts, and Admin is able to log in and manually unlock it.
However my 2nd scenario is, I need the account to be unlocked after 30min as I have specified.
I need to know if I am supposed to be calling any separate method for unlock_in to work.
I don´t know if this is still relevant, but the code below solve for me:
user.unlock_access!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With