rails devise trigger lock of lockable -


by default, n failed attempts log in locks user's account.

i want have method call lock account, or @ least trigger code says "hey account has n failed attempts should lock it".

i can increment number of failed attempts, not trigger account getting locked.

example uses: user must give current password change email, n failed attempts locks account. or user super paranoid , wants have button locks account (and boots users out).

the lockable module adds lock_access!, unlock_access! , access_locked? (amongst other methods) user model. should able call them directly, or call them other methods add further logic (e.g. example of n attempts give password change email address). lock_access! takes option in devise 3.2.3+ skips sending email instructions if want. see:

https://github.com/plataformatec/devise/blob/v3.2.3/lib/devise/models/lockable.rb


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -