Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fac2537 authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Merge branch 'log-client-in-patch' into 'main'

performance fix, replace alt domain suffix in client login

See merge request !114
parents e21af9e8 f02e8d4c
Loading
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -66,3 +66,19 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll
 		Util::emitHook(
 			'\OCA\Files_Sharing\API\Server2Server',
 			'preLoginNameUsedAsUserName',

--- ./lib/private/User/Session.php	2022-08-10 15:39:33.131890282 +0530
+++ ./lib/private/User/Session-new.php	2022-08-10 15:48:23.236165783 +0530
@@ -438,7 +438,11 @@
 								IRequest $request,
 								OC\Security\Bruteforce\Throttler $throttler) {
 		$currentDelay = $throttler->sleepDelay($request->getRemoteAddress(), 'login');
-
+		
+		$altDomain = $this->config->getSystemValue('alt_mail_domain', '');
+		$altDomainSuffix = !empty($altDomain) ? '@' . $altDomain : '';
+		$user = str_replace($altDomainSuffix, '', $user);
+		
 		if ($this->manager instanceof PublicEmitter) {
 			$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
 		}