From 62d0a299d84bad081b9ba683c74af7eeb672cc3d Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Mon, 15 Jun 2020 11:58:40 +0300 Subject: [PATCH] magento/magento2-login-as-customer#144: "Login as Customer" functionality should be enabled by default. --- app/code/Magento/LoginAsCustomer/Plugin/AdminLogoutPlugin.php | 2 +- app/code/Magento/LoginAsCustomer/etc/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/LoginAsCustomer/Plugin/AdminLogoutPlugin.php b/app/code/Magento/LoginAsCustomer/Plugin/AdminLogoutPlugin.php index 3b8d26129a91e..f473dcebcf9ea 100644 --- a/app/code/Magento/LoginAsCustomer/Plugin/AdminLogoutPlugin.php +++ b/app/code/Magento/LoginAsCustomer/Plugin/AdminLogoutPlugin.php @@ -45,7 +45,7 @@ public function __construct( */ public function beforeLogout(Auth $subject): void { - if ($this->config->isEnabled()) { + if ($this->config->isEnabled() && $subject->getUser()) { $userId = (int)$subject->getUser()->getId(); $this->deleteAuthenticationDataForUser->execute($userId); } diff --git a/app/code/Magento/LoginAsCustomer/etc/config.xml b/app/code/Magento/LoginAsCustomer/etc/config.xml index 936ae1ff2f05d..7e39cc39145eb 100644 --- a/app/code/Magento/LoginAsCustomer/etc/config.xml +++ b/app/code/Magento/LoginAsCustomer/etc/config.xml @@ -10,7 +10,7 @@ - 0 + 1 0 60