Skip to content

Commit

Permalink
Mark whether login is by an admin
Browse files Browse the repository at this point in the history
  • Loading branch information
easeq committed Dec 3, 2019
1 parent a58beed commit 4a83757
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions Controller/Login/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function execute()

$this->customerSession->loginById($customerId);
$this->customerSession->regenerateId();
$this->customerSession->setIsAdminLogin(true);
$this->loginAsCustomerSession->setCustomerId(null);

return $resultRedirect->setPath('customer/account');
Expand Down
4 changes: 1 addition & 3 deletions Plugin/Frontend/Magento/PageCache/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public function __construct(LoginAsCustomerHelper $helper, CustomerSession $cust
*/
public function afterIsEnabled(PageCacheConfig $subject, $result)
{
return $result
&& $this->customerSession->getAdminLoginCustomerId()
&& !$this->helper->isDisabledPageCacheForAdmin();
return $result || ($this->customerSession->getIsAdminLogin() && !$this->helper->isDisabledPageCacheForAdmin());
}
}

0 comments on commit 4a83757

Please sign in to comment.