40 parent::__construct($context);
41 $this->customerSession = $customerSession;
52 $lastCustomerId = $this->customerSession->getId();
53 $this->customerSession->logout()
54 ->setBeforeAuthUrl($this->
_redirect->getRefererUrl())
55 ->setLastCustomerId($lastCustomerId);
58 $resultJson = $this->resultJsonFactory->create();
59 return $resultJson->setData([
'message' =>
'Logout Successful']);
_redirect($path, $arguments=[])
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory)