mirror of
https://github.com/nextcloud/server.git
synced 2026-02-11 14:54:02 -05:00
dont try email login if the provider username is not a valid email
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
cb0bfae73e
commit
fbebc4bfe7
1 changed files with 3 additions and 0 deletions
|
|
@ -450,6 +450,9 @@ class Session implements IUserSession, Emitter {
|
|||
if (!$this->login($user, $password)) {
|
||||
|
||||
// Failed, maybe the user used their email address
|
||||
if (!filter_var($user, FILTER_VALIDATE_EMAIL)) {
|
||||
return false;
|
||||
}
|
||||
$users = $this->manager->getByEmail($user);
|
||||
if (!(\count($users) === 1 && $this->login($users[0]->getUID(), $password))) {
|
||||
$this->logger->warning('Login failed: \'' . $user . '\' (Remote IP: \'' . \OC::$server->getRequest()->getRemoteAddress() . '\')', ['app' => 'core']);
|
||||
|
|
|
|||
Loading…
Reference in a new issue