Expand description
lockable module โ locks an account after repeated failed sign-ins and
auto-unlocks after auth.unlock_in seconds. Operates on the conventional
users columns (failed_attempts, locked_at) via backend-agnostic SQL,
gated at runtime by auth.modules. Email-based unlock is a follow-up; the
time-based unlock strategy needs no mailer.
Functionsยง
- ensure_
not_ locked - Reject a sign-in attempt for a locked account. Auto-unlocks (and allows the
attempt) once
unlock_inseconds have elapsed sincelocked_at. No-op when the module is disabled. - record_
failure - Record a failed sign-in: increment
failed_attemptsand lock the account (stamplocked_at) once it reachesmaximum_attempts. No-op when disabled. - reset_
attempts - Clear the failed-attempt counter and lock on a successful sign-in. No-op when the module is disabled.