File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
app/code/Magento/LoginAsCustomer Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ public function __construct(
45
45
*/
46
46
public function beforeLogout (Auth $ subject ): void
47
47
{
48
- if ($ this ->config ->isEnabled () && $ subject ->getUser ()) {
49
- $ userId = (int )$ subject ->getUser ()->getId ();
48
+ $ user = $ subject ->getUser ();
49
+ if ($ this ->config ->isEnabled () && $ user && $ user ->getIsLoggedAsCustomer ()) {
50
+ $ userId = (int )$ user ->getId ();
50
51
$ this ->deleteAuthenticationDataForUser ->execute ($ userId );
51
52
}
52
53
}
Original file line number Diff line number Diff line change 13
13
<preference for =" Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataForUserInterface" type =" Magento\LoginAsCustomer\Model\ResourceModel\DeleteAuthenticationDataForUser" />
14
14
<preference for =" Magento\LoginAsCustomerApi\Api\ConfigInterface" type =" Magento\LoginAsCustomer\Model\Config" />
15
15
<preference for =" Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerSessionActiveInterface" type =" Magento\LoginAsCustomer\Model\ResourceModel\IsLoginAsCustomerSessionActive" />
16
+ <type name =" Magento\Backend\Model\Auth" >
17
+ <plugin name =" login_as_customer_admin_logout" type =" Magento\LoginAsCustomer\Plugin\AdminLogoutPlugin" />
18
+ </type >
16
19
</config >
You can’t perform that action at this time.
0 commit comments