Loading patches/002-login-without-domain.patch +3 −5 Original line number Diff line number Diff line Loading @@ -80,18 +80,16 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll --- ./lib/private/User/Session.php 2026-03-23 17:46:39.585001447 +0600 +++ ./lib/private/User/Session-new.php 2026-03-23 17:59:52.577453313 +0600 @@ -384,6 +384,14 @@ @@ -384,6 +384,12 @@ $remoteAddress = $request->getRemoteAddress(); $currentDelay = $throttler->sleepDelayOrThrowOnMax($remoteAddress, 'login'); + $mainDomain = $this->config->getSystemValue('main_domain', ''); + $legacyDomain = $this->config->getSystemValue('legacy_domain', ''); + $mainDomainSuffix = !empty($mainDomain) ? '@' . $mainDomain : ''; + // Don't replace legacy domain in login name + if ($mainDomain !== $legacyDomain) { + // If user with given UID exists, we don't want to replace the domain + if (!$this->manager->userExists($user)) { + $user = str_replace($mainDomainSuffix, '', $user); + } + if ($this->manager instanceof PublicEmitter) { $this->manager->emit('\OC\User', 'preLogin', [$user, $password]); } Loading
patches/002-login-without-domain.patch +3 −5 Original line number Diff line number Diff line Loading @@ -80,18 +80,16 @@ diff --git ./core/Controller/LoginController.php ./core/Controller/LoginControll --- ./lib/private/User/Session.php 2026-03-23 17:46:39.585001447 +0600 +++ ./lib/private/User/Session-new.php 2026-03-23 17:59:52.577453313 +0600 @@ -384,6 +384,14 @@ @@ -384,6 +384,12 @@ $remoteAddress = $request->getRemoteAddress(); $currentDelay = $throttler->sleepDelayOrThrowOnMax($remoteAddress, 'login'); + $mainDomain = $this->config->getSystemValue('main_domain', ''); + $legacyDomain = $this->config->getSystemValue('legacy_domain', ''); + $mainDomainSuffix = !empty($mainDomain) ? '@' . $mainDomain : ''; + // Don't replace legacy domain in login name + if ($mainDomain !== $legacyDomain) { + // If user with given UID exists, we don't want to replace the domain + if (!$this->manager->userExists($user)) { + $user = str_replace($mainDomainSuffix, '', $user); + } + if ($this->manager instanceof PublicEmitter) { $this->manager->emit('\OC\User', 'preLogin', [$user, $password]); }