identify user by username as well
This commit is contained in:
3 files changed
+7
-7
No files matched your search
@@ -159,7 +159,7 @@ class LoginController
|
||||
return new JsonContent(['success' => true]);
|
||||
}
|
||||
|
||||
$user = $this->userRepository->getByEmail(\Container::$request->post('email'));
|
||||
$user = $this->userRepository->getByEmailOrUsername(\Container::$request->post('email'));
|
||||
|
||||
if ($user === null) {
|
||||
if (strlen(\Container::$request->post('password')) < 6) {
|
||||
@@ -190,7 +190,7 @@ class LoginController
|
||||
|
||||
return new JsonContent([
|
||||
'error' => [
|
||||
'errorText' => 'User found with the given email address, but the account is not activated. ' .
|
||||
'errorText' => 'User found with the given email address / username, but the account is not activated. ' .
|
||||
'Please check your email and click on the activation link!'
|
||||
]
|
||||
]);
|
||||
@@ -485,12 +485,12 @@ class LoginController
|
||||
}
|
||||
}
|
||||
|
||||
$user = $this->userRepository->getByEmail(\Container::$request->post('email'));
|
||||
$user = $this->userRepository->getByEmailOrUsername(\Container::$request->post('email'));
|
||||
|
||||
if ($user === null) {
|
||||
return new JsonContent([
|
||||
'error' => [
|
||||
'errorText' => 'No user found with the given email address. You can <a href="/signup" title="Sign up">sign up</a>!'
|
||||
'errorText' => 'No user found with the given email address / username. You can <a href="/signup" title="Sign up">sign up</a>!'
|
||||
]
|
||||
]);
|
||||
}
|
||||
@@ -500,7 +500,7 @@ class LoginController
|
||||
|
||||
return new JsonContent([
|
||||
'error' => [
|
||||
'errorText' => 'User found with the given email address, but the account is not activated. ' .
|
||||
'errorText' => 'User found with the given email address / username, but the account is not activated. ' .
|
||||
'Please check your email and click on the activation link!'
|
||||
]
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user