|
16 | 16 | use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; |
17 | 17 | use Magento\Framework\App\Config\ScopeConfigInterface; |
18 | 18 | use Magento\Framework\Controller\ResultFactory; |
19 | | -use Magento\Framework\UrlFactory; |
20 | 19 | use Magento\Framework\Exception\StateException; |
| 20 | +use Magento\Framework\UrlFactory; |
21 | 21 | use Magento\Store\Model\ScopeInterface; |
22 | 22 | use Magento\Store\Model\StoreManagerInterface; |
23 | 23 |
|
@@ -161,15 +161,9 @@ public function execute() |
161 | 161 | } |
162 | 162 |
|
163 | 163 | try { |
164 | | - // log in and send greeting email |
| 164 | + //activate and send greeting email |
165 | 165 | $customerEmail = $this->customerRepository->getById($customerId)->getEmail(); |
166 | | - $customer = $this->customerAccountManagement->activate($customerEmail, $key); |
167 | | - $this->session->setCustomerDataAsLoggedIn($customer); |
168 | | - if ($this->getCookieManager()->getCookie('mage-cache-sessid')) { |
169 | | - $metadata = $this->getCookieMetadataFactory()->createCookieMetadata(); |
170 | | - $metadata->setPath('/'); |
171 | | - $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata); |
172 | | - } |
| 166 | + $this->customerAccountManagement->activate($customerEmail, $key); |
173 | 167 | $this->messageManager->addSuccess($this->getSuccessMessage()); |
174 | 168 | $resultRedirect->setUrl($this->getSuccessRedirect()); |
175 | 169 | return $resultRedirect; |
@@ -197,7 +191,7 @@ protected function getSuccessMessage() |
197 | 191 | 'If you are a registered VAT customer, please click <a href="%1">here</a> to enter your shipping address for proper VAT calculation.', |
198 | 192 | $this->urlModel->getUrl('customer/address/edit') |
199 | 193 | ); |
200 | | - // @codingStandardsIgnoreEnd |
| 194 | + // @codingStandardsIgnoreEnd |
201 | 195 | } else { |
202 | 196 | // @codingStandardsIgnoreStart |
203 | 197 | $message = __( |
|
0 commit comments