Skip to content

Commit 69ffa37

Browse files
author
Cari Spruiell
committed
Merge remote-tracking branch 'remotes/origin/MAGETWO-37821-Wrong-message-is-displayed-after-exceeding-maximum-login' into develop
2 parents b8b1c4e + f21c1e5 commit 69ffa37

File tree

14 files changed

+31
-23
lines changed

14 files changed

+31
-23
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getCredentialStorage()
145145
public function login($username, $password)
146146
{
147147
if (empty($username) || empty($password)) {
148-
self::throwException(__('Please correct the user name or password.'));
148+
self::throwException(__('You did not sign in correctly or your account is temporarily disabled.'));
149149
}
150150

151151
try {
@@ -162,7 +162,7 @@ public function login($username, $password)
162162
}
163163

164164
if (!$this->getAuthStorage()->getUser()) {
165-
self::throwException(__('Please correct the user name or password.'));
165+
self::throwException(__('You did not sign in correctly or your account is temporarily disabled.'));
166166
}
167167
} catch (PluginAuthenticationException $e) {
168168
$this->_eventManager->dispatch(
@@ -175,7 +175,9 @@ public function login($username, $password)
175175
'backend_auth_user_login_failed',
176176
['user_name' => $username, 'exception' => $e]
177177
);
178-
self::throwException(__($e->getMessage()? : 'Please correct the user name or password.'));
178+
self::throwException(
179+
__($e->getMessage()? : 'You did not sign in correctly or your account is temporarily disabled.')
180+
);
179181
}
180182
}
181183

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function setUp()
5050

5151
/**
5252
* @expectedException \Magento\Framework\Exception\AuthenticationException
53-
* @expectedExceptionMessage Please correct the user name or password.
53+
* @expectedExceptionMessage You did not sign in correctly or your account is temporarily disabled.
5454
*/
5555
public function testLoginFailed()
5656
{
@@ -59,8 +59,9 @@ public function testLoginFailed()
5959
->method('create')
6060
->with('Magento\Backend\Model\Auth\Credential\StorageInterface')
6161
->will($this->returnValue($this->_credentialStorage));
62-
$exceptionMock =
63-
new \Magento\Framework\Exception\LocalizedException(__('Please correct the user name or password.'));
62+
$exceptionMock = new \Magento\Framework\Exception\LocalizedException(
63+
__('You did not sign in correctly or your account is temporarily disabled.')
64+
);
6465
$this->_credentialStorage
6566
->expects($this->once())
6667
->method('login')

app/code/Magento/Backend/i18n/de_DE.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/es_ES.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/fr_FR.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/nl_NL.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/pt_BR.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Backend/i18n/zh_CN.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Synchronizing...,Synchronizing...
287287
"Current Month","Current Month"
288288
YTD,YTD
289289
2YTD,2YTD
290-
"Please correct the user name or password.","Please correct the user name or password."
290+
"You did not sign in correctly or your account is temporarily disabled.","You did not sign in correctly or your account is temporarily disabled."
291291
"Authentication error occurred.","Authentication error occurred."
292292
"Please specify the admin custom URL.","Please specify the admin custom URL."
293293
"Invalid %1. %2","Invalid %1. %2"

app/code/Magento/Integration/Model/AdminTokenService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public function createAdminAccessToken($username, $password)
7979
* Constant cannot be created in Auth Model since it uses legacy translation that doesn't support it.
8080
* Need to make sure that this is refactored once exception handling is updated in Auth Model.
8181
*/
82-
throw new AuthenticationException(__('Please correct the user name or password.'));
82+
throw new AuthenticationException(
83+
__('You did not sign in correctly or your account is temporarily disabled.')
84+
);
8385
}
8486
return $this->tokenModelFactory->create()->createAdminToken($this->userModel->getId())->getToken();
8587
}

0 commit comments

Comments
 (0)