Skip to content

Commit 05fccd9

Browse files
author
Anna Bukatar
committed
ACP2E-1763: Issue with Cart when logged in as customer from admin
1 parent 049bff6 commit 05fccd9

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

app/code/Magento/Persistent/Model/Plugin/LoginAsCustomerCleanUp.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ public function __construct(PersistentSession $persistentSession)
2626
}
2727

2828
/**
29-
* Cleans persistence cookie on sales representative login
29+
* Disable persistence for sales representative login
3030
*
3131
* @param AuthenticateCustomerBySecretInterface $subject
32-
* @param string $secret
33-
* @return string
32+
* @return void
3433
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3534
*/
36-
public function beforeExecute(AuthenticateCustomerBySecretInterface $subject, string $secret)
35+
public function afterExecute(AuthenticateCustomerBySecretInterface $subject)
3736
{
3837
if ($this->persistentSession->isPersistent()) {
3938
$this->persistentSession->getSession()->removePersistentCookie();
4039
}
41-
return $secret;
4240
}
4341
}

app/code/Magento/Persistent/Test/Unit/Model/Plugin/LoginAsCustomerCleanUpTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ protected function setUp(): void
4646

4747
public function testBeforeExecute()
4848
{
49-
$key = 'key';
5049
$this->persistentSessionMock->expects($this->once())->method('isPersistent')->willReturn(true);
5150
$this->persistentSessionModelMock->expects($this->once())->method('removePersistentCookie');
52-
$result = $this->plugin->beforeExecute($this->subjectMock, $key);
53-
$this->assertEquals($key, $result);
51+
$result = $this->plugin->afterExecute($this->subjectMock);
52+
$this->assertEquals(null, $result);
5453
}
5554
}

0 commit comments

Comments
 (0)