54 $this->_actionFlag = $actionFlag;
67 $formId =
'backend_forgotpassword';
68 $captchaModel = $this->_helper->getCaptcha($formId);
70 $email = (string)
$observer->getControllerAction()->getRequest()->getParam(
'email');
74 && $captchaModel->isRequired()
75 && !$captchaModel->isCorrect($this->captchaStringResolver->resolve(
$controller->getRequest(), $formId))
77 $this->_session->setEmail((
string)
$controller->getRequest()->getPost(
'email'));
78 $this->_actionFlag->set(
'', \
Magento\Framework\
App\Action\Action::FLAG_NO_DISPATCH,
true);
79 $this->messageManager->addError(
__(
'Incorrect CAPTCHA'));
81 $controller->getUrl(
'*/*/forgotpassword', [
'_nosecret' =>
true])
__construct(\Magento\Captcha\Helper\Data $helper, CaptchaStringResolver $captchaStringResolver, \Magento\Framework\Session\SessionManagerInterface $session, \Magento\Framework\App\ActionFlag $actionFlag, \Magento\Framework\Message\ManagerInterface $messageManager)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
execute(\Magento\Framework\Event\Observer $observer)