Skip to content

Commit cb75964

Browse files
committed
Merge remote-tracking branch 'origin/BUG#AC-2235' into spartans_pr_04082022
2 parents 90b91d4 + a5e4da7 commit cb75964

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,9 @@ public function resetPassword($email, $resetToken, $newPassword)
726726
$customerSecure->setRpToken(null);
727727
$customerSecure->setRpTokenCreatedAt(null);
728728
$customerSecure->setPasswordHash($this->createPasswordHash($newPassword));
729+
$customerSecure->setFailuresNum(0);
730+
$customerSecure->setFirstFailure(null);
731+
$customerSecure->setLockExpires(null);
729732
$this->sessionCleaner->clearFor((int)$customer->getId());
730733
$this->customerRepository->save($customer);
731734

@@ -1216,6 +1219,7 @@ public function isReadonly($customerId)
12161219
* @return $this
12171220
* @throws LocalizedException
12181221
* @deprecated 100.1.0
1222+
* @see MAGETWO-71174
12191223
*/
12201224
protected function sendNewAccountEmail(
12211225
$customer,
@@ -1259,6 +1263,7 @@ protected function sendNewAccountEmail(
12591263
* @throws LocalizedException
12601264
* @throws NoSuchEntityException
12611265
* @deprecated 100.1.0
1266+
* @see MAGETWO-71174
12621267
*/
12631268
protected function sendPasswordResetNotificationEmail($customer)
12641269
{
@@ -1272,6 +1277,7 @@ protected function sendPasswordResetNotificationEmail($customer)
12721277
* @param int|string|null $defaultStoreId
12731278
* @return int
12741279
* @deprecated 100.1.0
1280+
* @see MAGETWO-71174
12751281
* @throws LocalizedException
12761282
*/
12771283
protected function getWebsiteStoreId($customer, $defaultStoreId = null)
@@ -1289,6 +1295,7 @@ protected function getWebsiteStoreId($customer, $defaultStoreId = null)
12891295
*
12901296
* @return array
12911297
* @deprecated 100.1.0
1298+
* @see MAGETWO-71174
12921299
*/
12931300
protected function getTemplateTypes()
12941301
{
@@ -1322,6 +1329,7 @@ protected function getTemplateTypes()
13221329
* @return $this
13231330
* @throws MailException
13241331
* @deprecated 100.1.0
1332+
* @see MAGETWO-71174
13251333
*/
13261334
protected function sendEmailTemplate(
13271335
$customer,
@@ -1476,6 +1484,7 @@ public function changeResetPasswordLinkToken(CustomerInterface $customer, string
14761484
* @throws LocalizedException
14771485
* @throws NoSuchEntityException
14781486
* @deprecated 100.1.0
1487+
* @see MAGETWO-71174
14791488
*/
14801489
public function sendPasswordReminderEmail($customer)
14811490
{
@@ -1505,6 +1514,7 @@ public function sendPasswordReminderEmail($customer)
15051514
* @throws LocalizedException
15061515
* @throws NoSuchEntityException
15071516
* @deprecated 100.1.0
1517+
* @see MAGETWO-71174
15081518
*/
15091519
public function sendPasswordResetConfirmationEmail($customer)
15101520
{
@@ -1550,6 +1560,7 @@ protected function getAddressById(CustomerInterface $customer, $addressId)
15501560
* @return Data\CustomerSecure
15511561
* @throws NoSuchEntityException
15521562
* @deprecated 100.1.0
1563+
* @see MAGETWO-71174
15531564
*/
15541565
protected function getFullCustomerObject($customer)
15551566
{
@@ -1595,6 +1606,7 @@ private function disableAddressValidation($customer)
15951606
*
15961607
* @return EmailNotificationInterface
15971608
* @deprecated 100.1.0
1609+
* @see MAGETWO-71174
15981610
*/
15991611
private function getEmailNotification()
16001612
{

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,10 @@ private function reInitModel(): void
18201820
'getPasswordHash',
18211821
'setPasswordHash',
18221822
'setRpToken',
1823-
'setRpTokenCreatedAt'
1823+
'setRpTokenCreatedAt',
1824+
'setFailuresNum',
1825+
'setFirstFailure',
1826+
'setLockExpires',
18241827
]
18251828
)
18261829
->getMock();
@@ -2039,6 +2042,9 @@ function ($string) {
20392042
$this->customerSecure->expects($this->once())->method('setRpToken')->with(null);
20402043
$this->customerSecure->expects($this->once())->method('setRpTokenCreatedAt')->with(null);
20412044
$this->customerSecure->expects($this->any())->method('setPasswordHash')->willReturn(null);
2045+
$this->customerSecure->expects($this->once())->method('setFailuresNum')->with(0);
2046+
$this->customerSecure->expects($this->once())->method('setFirstFailure')->with(null);
2047+
$this->customerSecure->expects($this->once())->method('setLockExpires')->with(null);
20422048
$this->sessionCleanerMock->expects($this->once())->method('clearFor')->with($customerId)->willReturnSelf();
20432049

20442050
$this->assertTrue($this->accountManagement->resetPassword($customerEmail, $resetToken, $newPassword));

0 commit comments

Comments
 (0)