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

Commit 0edf0e64 authored by Akhil's avatar Akhil 🙂
Browse files

fix: don't replace main domain if it is same as legacy domain

parent 6ece4c1e
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -80,13 +80,17 @@ 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,10 @@
@@ -384,6 +384,14 @@
 		$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) {
+			$user = str_replace($mainDomainSuffix, '', $user);
+		}
+
 		if ($this->manager instanceof PublicEmitter) {
 			$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);