File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
app/code/Magento/Persistent Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
7+
8+ namespace Magento \Persistent \Model \Plugin ;
9+
10+ use Magento \LoginAsCustomerApi \Api \AuthenticateCustomerBySecretInterface ;
11+ use Magento \Persistent \Helper \Session as PersistentSession ;
12+
13+ class LoginAsCustomerCleanUp
14+ {
15+ /**
16+ * @var PersistentSession
17+ */
18+ private $ persistentSession ;
19+
20+ /**
21+ * @param PersistentSession $persistentSession
22+ */
23+ public function __construct (PersistentSession $ persistentSession )
24+ {
25+ $ this ->persistentSession = $ persistentSession ;
26+ }
27+
28+ /**
29+ * @param AuthenticateCustomerBySecretInterface $subject
30+ * @param string $secret
31+ * @return string
32+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
33+ */
34+ public function beforeExecute (AuthenticateCustomerBySecretInterface $ subject , string $ secret )
35+ {
36+ if ($ this ->persistentSession ->isPersistent ()) {
37+ $ this ->persistentSession ->getSession ()->removePersistentCookie ();
38+ }
39+ return $ secret ;
40+ }
41+ }
Original file line number Diff line number Diff line change 5757 <argument name =" shippingAssignmentProcessor" xsi : type =" object" >Magento\Quote\Model\Quote\ShippingAssignment\ShippingAssignmentProcessor\Proxy</argument >
5858 </arguments >
5959 </type >
60+ <type name =" Magento\LoginAsCustomerApi\Api\AuthenticateCustomerBySecretInterface" >
61+ <plugin name =" login_as_customer_cleanup" type =" Magento\Persistent\Model\Plugin\LoginAsCustomerCleanUp" />
62+ </type >
6063</config >
You can’t perform that action at this time.
0 commit comments