helper = $helper; $this->resLogFactory = $resLogFactory; } /** * Reset Attempts For Frontend * * @param \Magento\Framework\Event\Observer $observer * @return \Magento\Captcha\Observer\ResetAttemptForFrontendObserver */ public function execute(\Magento\Framework\Event\Observer $observer) { $email = $observer->getEmail(); $captchaModel = $this->helper->getCaptcha(self::FORM_ID); $captchaModel->setShowCaptchaInSession(false); return $this->resLogFactory->create()->deleteUserAttempts($email); } }