Merge pull request #34073 from nextcloud/login-email-filter

dont try email login if the provider username is not a valid email
pull/34113/head
Vincent Petry 3 years ago committed by GitHub
commit 25888a3d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      lib/private/User/Session.php

@ -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…
Cancel
Save