Skip to content

Commit 52a52d9

Browse files
committed
Merge remote-tracking branch 'origin/MC-31575' into 2.3-develop-pr38
2 parents 8d1e555 + 2580b81 commit 52a52d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/Customer/Model/AccountManagement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,10 +1045,10 @@ private function changePasswordForCustomer($customer, $currentPassword, $newPass
10451045
}
10461046
$customerEmail = $customer->getEmail();
10471047
$this->credentialsValidator->checkPasswordDifferentFromEmail($customerEmail, $newPassword);
1048+
$this->checkPasswordStrength($newPassword);
10481049
$customerSecure = $this->customerRegistry->retrieveSecureData($customer->getId());
10491050
$customerSecure->setRpToken(null);
10501051
$customerSecure->setRpTokenCreatedAt(null);
1051-
$this->checkPasswordStrength($newPassword);
10521052
$customerSecure->setPasswordHash($this->createPasswordHash($newPassword));
10531053
$this->destroyCustomerSessions($customer->getId());
10541054
$this->disableAddressValidation($customer);
@@ -1630,6 +1630,7 @@ private function getEmailNotification()
16301630
*/
16311631
private function destroyCustomerSessions($customerId)
16321632
{
1633+
$this->sessionManager->regenerateId();
16331634
$sessionLifetime = $this->scopeConfig->getValue(
16341635
\Magento\Framework\Session\Config::XML_PATH_COOKIE_LIFETIME,
16351636
\Magento\Store\Model\ScopeInterface::SCOPE_STORE

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,7 @@ public function testChangePassword()
15511551
->with($customer);
15521552

15531553
$this->sessionManager->expects($this->atLeastOnce())->method('getSessionId');
1554+
$this->sessionManager->expects($this->atLeastOnce())->method('regenerateId');
15541555

15551556
$visitor = $this->getMockBuilder(\Magento\Customer\Model\Visitor::class)
15561557
->disableOriginalConstructor()
@@ -1628,6 +1629,7 @@ function ($string) {
16281629

16291630
$this->sessionManager->method('isSessionExists')->willReturn(false);
16301631
$this->sessionManager->expects($this->atLeastOnce())->method('getSessionId');
1632+
$this->sessionManager->expects($this->atLeastOnce())->method('regenerateId');
16311633
$visitor = $this->getMockBuilder(\Magento\Customer\Model\Visitor::class)
16321634
->disableOriginalConstructor()
16331635
->setMethods(['getSessionId'])

0 commit comments

Comments
 (0)