diff --git a/patches/002-login-without-domain.patch b/patches/002-login-without-domain.patch index faefb4a7ebd02e9afe1068fdaa8f9f26891f6c55..ff52c4c01922c29bf0cf8678c50302922a47ec9f 100644 --- a/patches/002-login-without-domain.patch +++ b/patches/002-login-without-domain.patch @@ -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]); + }