summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-09-14 14:04:13 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-09-16 13:27:10 +0000
commitfbebc4bfe7de06c90dbd2d34a2f688ea3e6d53ea (patch)
treee1c09aafb5974f1a07d92e332660b646118db415 /lib
parentcb0bfae73e73b4412e6178ac7036bac13bbe02dd (diff)
downloadnextcloud-server-fbebc4bfe7de06c90dbd2d34a2f688ea3e6d53ea.tar.gz
nextcloud-server-fbebc4bfe7de06c90dbd2d34a2f688ea3e6d53ea.zip
dont try email login if the provider username is not a valid email
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/User/Session.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index 365a01c4595..8440e830e67 100644
--- a/lib/private/User/Session.php
+++ b/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']);