Skip to content

Commit

Permalink
fix: use handleLoginFailed for invalid email address
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Jul 10, 2023
1 parent 7b6a2a0 commit bdc0f84
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,7 @@ public function logClientIn($user,
}
$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']);

$throttler->registerAttempt('login', $request->getRemoteAddress(), ['user' => $user]);

$this->dispatcher->dispatchTyped(new OC\Authentication\Events\LoginFailed($user));

if ($currentDelay === 0) {
$throttler->sleepDelay($request->getRemoteAddress(), 'login');
}
$this->handleLoginFailed($throttler, $currentDelay, $remoteAddress, $user, $password);
return false;
}
}
Expand Down

0 comments on commit bdc0f84

Please sign in to comment.