Skip to content

Commit 5614386

Browse files
committed
ACP2E-1332: activate customer account and redirect to login
1 parent 39f0be8 commit 5614386

File tree

1 file changed

+4
-10
lines changed
  • app/code/Magento/Customer/Controller/Account

1 file changed

+4
-10
lines changed

app/code/Magento/Customer/Controller/Account/Confirm.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
1717
use Magento\Framework\App\Config\ScopeConfigInterface;
1818
use Magento\Framework\Controller\ResultFactory;
19-
use Magento\Framework\UrlFactory;
2019
use Magento\Framework\Exception\StateException;
20+
use Magento\Framework\UrlFactory;
2121
use Magento\Store\Model\ScopeInterface;
2222
use Magento\Store\Model\StoreManagerInterface;
2323

@@ -161,15 +161,9 @@ public function execute()
161161
}
162162

163163
try {
164-
// log in and send greeting email
164+
//activate and send greeting email
165165
$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);
173167
$this->messageManager->addSuccess($this->getSuccessMessage());
174168
$resultRedirect->setUrl($this->getSuccessRedirect());
175169
return $resultRedirect;
@@ -197,7 +191,7 @@ protected function getSuccessMessage()
197191
'If you are a registered VAT customer, please click <a href="%1">here</a> to enter your shipping address for proper VAT calculation.',
198192
$this->urlModel->getUrl('customer/address/edit')
199193
);
200-
// @codingStandardsIgnoreEnd
194+
// @codingStandardsIgnoreEnd
201195
} else {
202196
// @codingStandardsIgnoreStart
203197
$message = __(

0 commit comments

Comments
 (0)