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(
4545 */
4646 public function beforeLogout (Auth $ subject ): void
4747 {
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 ();
5051 $ this ->deleteAuthenticationDataForUser ->execute ($ userId );
5152 }
5253 }
Original file line number Diff line number Diff line change 1313 <preference for =" Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataForUserInterface" type =" Magento\LoginAsCustomer\Model\ResourceModel\DeleteAuthenticationDataForUser" />
1414 <preference for =" Magento\LoginAsCustomerApi\Api\ConfigInterface" type =" Magento\LoginAsCustomer\Model\Config" />
1515 <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 >
1619</config >
You can’t perform that action at this time.
0 commit comments