LoginAttempt
in package
Table of Contents
Properties
- $loginAttemptMapper : LoginAttempt
- $rateLimitConfig : array<string|int, mixed>
- $remoteAddress : string
Methods
- __construct() : mixed
- deletedOldLoginAttempts() : void
- Delete all (failed) login attempts that are older than 3 months.
- logFailedLogin() : void
- Log a failed login attempt.
- loginAttemptsExceeded() : bool
- Check if there are too many login tries for a specific account.
Properties
$loginAttemptMapper read-only
private
LoginAttempt
$loginAttemptMapper
$rateLimitConfig read-only
private
array<string|int, mixed>
$rateLimitConfig
$remoteAddress read-only
private
string
$remoteAddress
Methods
__construct()
public
__construct(string $remoteAddress, LoginAttempt $loginAttemptMapper, array<string|int, mixed> $rateLimitConfig) : mixed
Parameters
- $remoteAddress : string
- $loginAttemptMapper : LoginAttempt
- $rateLimitConfig : array<string|int, mixed>
Tags
deletedOldLoginAttempts()
Delete all (failed) login attempts that are older than 3 months.
public
deletedOldLoginAttempts() : void
We can automatically DELETE all login attempts at once instead of retrieving them and iterating over them.
logFailedLogin()
Log a failed login attempt.
public
logFailedLogin(IdentityInterface $user) : void
Parameters
- $user : IdentityInterface
loginAttemptsExceeded()
Check if there are too many login tries for a specific account.
public
loginAttemptsExceeded(IdentityInterface $user) : bool
Parameters
- $user : IdentityInterface