33 private $remoteAddress;
47 $this->remoteAddress = $remoteAddress;
53 public function check($securityEventType, $accountReference =
null, $longIp =
null)
56 $allowedAttemptsNumber = $this->securityConfig->getMaxNumberPasswordResetRequests();
57 if ($isEnabled and $allowedAttemptsNumber) {
59 if (
$collection->count() >= $allowedAttemptsNumber) {
62 'We received too many requests for password resets. ' 63 .
'Please wait and try again later or contact %1.',
64 $this->securityConfig->getCustomerServiceEmail()
81 if (
null === $longIp) {
82 $longIp = $this->remoteAddress->getRemoteAddress();
84 $collection = $this->collectionFactory->create($securityEventType, $accountReference, $longIp);
85 $periodToCheck = $this->securityConfig->getLimitationTimePeriod();
__construct(ConfigInterface $securityConfig, CollectionFactory $collectionFactory, RemoteAddress $remoteAddress)
check($securityEventType, $accountReference=null, $longIp=null)
prepareCollection($securityEventType, $accountReference, $longIp)