Changed countRecentFailedAttempts() to use MySQL DATE_SUB(NOW(), INTERVAL ? MINUTE) instead of PHP-calculated cutoff time. This ensures consistent datetime comparison on the database server without timezone mismatches between PHP and MySQL. This fixes the issue where the AND attempted_at condition was filtering out all recent attempts due to timestamp comparison inconsistencies.
80 KiB
80 KiB