DbUsernameRecoveryRepository
final class DbUsernameRecoveryRepository implements UsernameRecoveryRepositoryInterface (View source)
SQL persistence for username recovery attempts and their rate-limit counters in username_recovery_requests.
Methods
bool
create(array $data)
Create a new username recovery request record
int
countRecentAttempts(string $email, int $seconds)
Count recent recovery attempts for a specific email address
int
countRecentAttemptsByIp(string $ip, int $seconds)
Count recent recovery attempts by IP address
int
deleteOlderThan(int $days = 30)
Delete old recovery request records
Details
__construct(PDO $db, ConfigurationInterface $config)
No description
bool
create(array $data)
Create a new username recovery request record
int
countRecentAttempts(string $email, int $seconds)
Count recent recovery attempts for a specific email address
int
countRecentAttemptsByIp(string $ip, int $seconds)
Count recent recovery attempts by IP address
int
deleteOlderThan(int $days = 30)
Delete old recovery request records
Cleanup strategy:
- Delete records older than the specified number of days
- Default: 30 days for audit trail purposes
This method can be called periodically for maintenance.