Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ResetAttemptForFrontendAccountEditObserver.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  const FORM_ID = 'user_edit';
16 
20  protected $helper;
21 
26 
33  public function __construct(
34  \Magento\Captcha\Helper\Data $helper,
35  \Magento\Captcha\Model\ResourceModel\LogFactory $resLogFactory
36  ) {
37  $this->helper = $helper;
38  $this->resLogFactory = $resLogFactory;
39  }
40 
47  public function execute(\Magento\Framework\Event\Observer $observer)
48  {
49  $email = $observer->getEmail();
50  $captchaModel = $this->helper->getCaptcha(self::FORM_ID);
51  $captchaModel->setShowCaptchaInSession(false);
52 
53  return $this->resLogFactory->create()->deleteUserAttempts($email);
54  }
55 }
$email
Definition: details.phtml:13
__construct(\Magento\Captcha\Helper\Data $helper, \Magento\Captcha\Model\ResourceModel\LogFactory $resLogFactory)