Skip to content

Commit 2197ba9

Browse files
author
Cari Spruiell
committed
MAGETWO-36701: Admin user isn't locked after exceeding maximum login failures attempts
- modified exception handling to use the message passed in the original exception - updated associated test
1 parent 5445f80 commit 2197ba9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/Backend/Model/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function login($username, $password)
175175
'backend_auth_user_login_failed',
176176
['user_name' => $username, 'exception' => $e]
177177
);
178-
self::throwException(__('Please correct the user name or password.'));
178+
self::throwException(__($e->getMessage()? : 'Please correct the user name or password.'));
179179
}
180180
}
181181

app/code/Magento/Backend/Test/Unit/Model/AuthTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testLoginFailed()
5959
->method('create')
6060
->with('Magento\Backend\Model\Auth\Credential\StorageInterface')
6161
->will($this->returnValue($this->_credentialStorage));
62-
$exceptionMock = new \Magento\Framework\Exception\LocalizedException(__('message'));
62+
$exceptionMock = new \Magento\Framework\Exception\LocalizedException(__(''));
6363
$this->_credentialStorage
6464
->expects($this->once())
6565
->method('login')

0 commit comments

Comments
 (0)