public authenticationAttempted ( integer $authenticationStatus ) : void | ||
$authenticationStatus | integer | One of WRONG_CREDENTIALS, AUTHENTICATION_SUCCESSFUL |
Résultat | void |
public function authenticationAttempted($authenticationStatus)
{
if ($authenticationStatus === TokenInterface::WRONG_CREDENTIALS) {
$this->failedAuthenticationCount++;
} elseif ($authenticationStatus === TokenInterface::AUTHENTICATION_SUCCESSFUL) {
$this->lastSuccessfulAuthenticationDate = new \DateTime();
$this->failedAuthenticationCount = 0;
} else {
throw new InvalidAuthenticationStatusException('Invalid authentication status.', 1449151375);
}
}