recordFailedAttempt method

void recordFailedAttempt()

Records a failed authentication attempt.

This is used for rate limiting to prevent brute force attacks.

Implementation

void recordFailedAttempt() {
  _failedAttempts++;
  _lastFailedAttempt = DateTime.now();
  _failedAttemptHistory.add(DateTime.now());

  // Keep only last 10 failed attempts for memory efficiency
  if (_failedAttemptHistory.length > 10) {
    _failedAttemptHistory.removeAt(0);
  }
}