OTPAttemptTracker class
Rate limiter for OTP verification attempts.
Constructors
- OTPAttemptTracker({int? maxAttempts, Duration? lockoutDuration})
Properties
- attempts → int
-
Get current attempt count.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLockedOut → bool
-
Check if currently locked out.
no setter
- lockoutDuration → Duration
-
final
- maxAttempts → int
-
final
- remainingLockout → Duration
-
Get remaining lockout time.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearLockout(
) → void - Clear lockout (for admin/testing purposes).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordAttempt(
) → bool - Record an attempt. Returns true if attempt is allowed, false if locked out.
-
resetAttempts(
) → void - Reset attempts on successful verification.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited