LoginAttemptService
class LoginAttemptService (View source)
A service for tracking and acting upon login attempts This service is NOT in charge of logging in users, it is meant to react to attempts
Properties
protected EntityManagerInterface | $entityManager | The entitymanager we're tracking attempts with |
|
protected Repository | $config | The config repository that has configuration for this service |
|
protected EventDispatcherInterface | $director | The event dispatcher we use to send out events |
|
protected LoginAttempt[] | $batch | The currently waiting login attempts |
|
protected array | $knownUsers | A cache for known users |
Methods
No description
Track a login attempt for a user
Determine the amount of attempts remaining for a username
Deactivate a given username
Manage a batched ORM operation
Resolve the user from username / user email
Details
__construct(EntityManagerInterface $entityManager, Repository $config, EventDispatcherInterface $director)
No description
$this
trackAttempt(string $username, string $password)
Track a login attempt for a user
int
remainingAttempts($username)
Determine the amount of attempts remaining for a username
deactivate($username)
Deactivate a given username
pruneAttempts(DateTime $before = null)
Prune old login attempts
private array
manageBatch(array $batch, int $max = 0)
Manage a batched ORM operation
private User|null
resolveUser($username)
Resolve the user from username / user email