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

Commit cc954aa1 authored by theronakpatel's avatar theronakpatel
Browse files

check for isUsernameTaken

parent e277355a
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -148,9 +148,10 @@ class SyncMissingUsersToCommon extends Command {
			return;
		}

		if ($this->userService->isUsernameTaken($username)) {
			$output->writeln(sprintf('<comment>User already exists in common database: %s</comment>', $username));
			return;
		// Strip legacy domain from username before checking in common DB
		$usernameWithoutDomain = $this->userService->stripLegacyDomainFromUsername($username);
		if ($this->userService->isUsernameTaken($usernameWithoutDomain)) {
			return; // Skip if already exists
		}

		try {