|
13 | 13 | use Magento\Customer\Api\AccountManagementInterface; |
14 | 14 | use Magento\Customer\Model\Url as CustomerUrl; |
15 | 15 | use Magento\Framework\App\CsrfAwareActionInterface; |
16 | | -use Magento\Framework\App\ObjectManager; |
17 | 16 | use Magento\Framework\App\Request\InvalidRequestException; |
18 | 17 | use Magento\Framework\App\RequestInterface; |
19 | 18 | use Magento\Framework\Controller\Result\Redirect; |
20 | 19 | use Magento\Framework\Exception\EmailNotConfirmedException; |
21 | 20 | use Magento\Framework\Exception\AuthenticationException; |
22 | 21 | use Magento\Framework\Data\Form\FormKey\Validator; |
23 | 22 | use Magento\Framework\Exception\LocalizedException; |
| 23 | +use Magento\Framework\Exception\State\UserLockedException; |
24 | 24 | use Magento\Framework\App\Config\ScopeConfigInterface; |
25 | 25 | use Magento\Customer\Controller\AbstractAccount; |
26 | 26 | use Magento\Framework\Phrase; |
27 | | -use Magento\Framework\Session\Generic; |
28 | 27 |
|
29 | 28 | /** |
30 | 29 | * Post login customer action. |
31 | 30 | * |
32 | 31 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects) |
33 | | - * @SuppressWarnings(PHPMD.ElseExpression) |
34 | | - * phpcs:disable Magento2.Annotation.MethodAnnotationStructure.InvalidDeprecatedTagUsage |
35 | 32 | */ |
36 | 33 | class LoginPost extends AbstractAccount implements CsrfAwareActionInterface, HttpPostActionInterface |
37 | 34 | { |
@@ -75,35 +72,27 @@ class LoginPost extends AbstractAccount implements CsrfAwareActionInterface, Htt |
75 | 72 | */ |
76 | 73 | private $customerUrl; |
77 | 74 |
|
78 | | - /** |
79 | | - * @var Generic |
80 | | - */ |
81 | | - private $generic; |
82 | | - |
83 | 75 | /** |
84 | 76 | * @param Context $context |
85 | 77 | * @param Session $customerSession |
86 | 78 | * @param AccountManagementInterface $customerAccountManagement |
87 | 79 | * @param CustomerUrl $customerHelperData |
88 | 80 | * @param Validator $formKeyValidator |
89 | 81 | * @param AccountRedirect $accountRedirect |
90 | | - * @param Generic $generic |
91 | 82 | */ |
92 | 83 | public function __construct( |
93 | 84 | Context $context, |
94 | 85 | Session $customerSession, |
95 | 86 | AccountManagementInterface $customerAccountManagement, |
96 | 87 | CustomerUrl $customerHelperData, |
97 | 88 | Validator $formKeyValidator, |
98 | | - AccountRedirect $accountRedirect, |
99 | | - Generic $generic = null |
| 89 | + AccountRedirect $accountRedirect |
100 | 90 | ) { |
101 | 91 | $this->session = $customerSession; |
102 | 92 | $this->customerAccountManagement = $customerAccountManagement; |
103 | 93 | $this->customerUrl = $customerHelperData; |
104 | 94 | $this->formKeyValidator = $formKeyValidator; |
105 | 95 | $this->accountRedirect = $accountRedirect; |
106 | | - $this->generic = $generic ?? ObjectManager::getInstance()->get(Generic::class); |
107 | 96 | parent::__construct($context); |
108 | 97 | } |
109 | 98 |
|
@@ -199,7 +188,6 @@ public function execute() |
199 | 188 | $login = $this->getRequest()->getPost('login'); |
200 | 189 | if (!empty($login['username']) && !empty($login['password'])) { |
201 | 190 | try { |
202 | | - $this->generic->setVisitorData([]); |
203 | 191 | $customer = $this->customerAccountManagement->authenticate($login['username'], $login['password']); |
204 | 192 | $this->session->setCustomerDataAsLoggedIn($customer); |
205 | 193 | if ($this->getCookieManager()->getCookie('mage-cache-sessid')) { |
|
0 commit comments