Skip to content

Commit a5e4da7

Browse files
committed
BUG#AC-2235: Customer who exceeded max login failures not able to login even after reset password- issue fixed
1 parent b5bda2d commit a5e4da7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ public function isReadonly($customerId)
12191219
* @return $this
12201220
* @throws LocalizedException
12211221
* @deprecated 100.1.0
1222+
* @see MAGETWO-71174
12221223
*/
12231224
protected function sendNewAccountEmail(
12241225
$customer,
@@ -1262,6 +1263,7 @@ protected function sendNewAccountEmail(
12621263
* @throws LocalizedException
12631264
* @throws NoSuchEntityException
12641265
* @deprecated 100.1.0
1266+
* @see MAGETWO-71174
12651267
*/
12661268
protected function sendPasswordResetNotificationEmail($customer)
12671269
{
@@ -1275,6 +1277,7 @@ protected function sendPasswordResetNotificationEmail($customer)
12751277
* @param int|string|null $defaultStoreId
12761278
* @return int
12771279
* @deprecated 100.1.0
1280+
* @see MAGETWO-71174
12781281
* @throws LocalizedException
12791282
*/
12801283
protected function getWebsiteStoreId($customer, $defaultStoreId = null)
@@ -1292,6 +1295,7 @@ protected function getWebsiteStoreId($customer, $defaultStoreId = null)
12921295
*
12931296
* @return array
12941297
* @deprecated 100.1.0
1298+
* @see MAGETWO-71174
12951299
*/
12961300
protected function getTemplateTypes()
12971301
{
@@ -1325,6 +1329,7 @@ protected function getTemplateTypes()
13251329
* @return $this
13261330
* @throws MailException
13271331
* @deprecated 100.1.0
1332+
* @see MAGETWO-71174
13281333
*/
13291334
protected function sendEmailTemplate(
13301335
$customer,
@@ -1479,6 +1484,7 @@ public function changeResetPasswordLinkToken(CustomerInterface $customer, string
14791484
* @throws LocalizedException
14801485
* @throws NoSuchEntityException
14811486
* @deprecated 100.1.0
1487+
* @see MAGETWO-71174
14821488
*/
14831489
public function sendPasswordReminderEmail($customer)
14841490
{
@@ -1508,6 +1514,7 @@ public function sendPasswordReminderEmail($customer)
15081514
* @throws LocalizedException
15091515
* @throws NoSuchEntityException
15101516
* @deprecated 100.1.0
1517+
* @see MAGETWO-71174
15111518
*/
15121519
public function sendPasswordResetConfirmationEmail($customer)
15131520
{
@@ -1553,6 +1560,7 @@ protected function getAddressById(CustomerInterface $customer, $addressId)
15531560
* @return Data\CustomerSecure
15541561
* @throws NoSuchEntityException
15551562
* @deprecated 100.1.0
1563+
* @see MAGETWO-71174
15561564
*/
15571565
protected function getFullCustomerObject($customer)
15581566
{
@@ -1598,6 +1606,7 @@ private function disableAddressValidation($customer)
15981606
*
15991607
* @return EmailNotificationInterface
16001608
* @deprecated 100.1.0
1609+
* @see MAGETWO-71174
16011610
*/
16021611
private function getEmailNotification()
16031612
{

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)