make it possible to have username

This commit is contained in:
bence committed 2023-04-09 02:29:46 +02:00
1 parent 366abf61b3
commit 151112bd2a
7 files changed
+44 -6

No files matched your search

+4 -4
View File
@@ -109,11 +109,11 @@ class LoginController
return new JsonContent(['success' => true]);
}
$user = $this->userRepository->getByEmail($this->request->post('email'));
$user = $this->userRepository->getByEmailOrUsername($this->request->post('email'));
if ($user === null || !$user->checkPassword($this->request->post('password'))) {
return new JsonContent([
'error' => [
'errorText' => 'No user found with the given email address or the given password is wrong. You can <a href="/password/requestReset?email=' .
'errorText' => 'No user found with the given email address / username or the given password is wrong. You can <a href="/password/requestReset?email=' .
urlencode($this->request->post('email')) . '" title="Request password reset">request password reset</a>!'
]
]);
@@ -200,11 +200,11 @@ class LoginController
}
}
$user = $this->userRepository->getByEmail($this->request->post('email'));
$user = $this->userRepository->getByEmailOrUsername($this->request->post('email'));
if ($user === null) {
return new JsonContent([
'error' => [
'errorText' => 'No user found with the given email address.'
'errorText' => 'No user found with the given email address / username.'
]
]);
}