diff --git a/web/src/features/auth/LoginPage.tsx b/web/src/features/auth/LoginPage.tsx index 034da3c6..82aa3846 100644 --- a/web/src/features/auth/LoginPage.tsx +++ b/web/src/features/auth/LoginPage.tsx @@ -4,7 +4,7 @@ import { Link, Navigate, useNavigate } from 'react-router-dom'; import { Icon } from '@/app/Icon'; import { PasswordInput } from '@/features/auth/components/PasswordInput'; -import { BASE_APP_NAME } from '@/lib/config'; +import { BASE_APP_NAME, FIXED_TENANT_CODE } from '@/lib/config'; import { getTinode, loginBasic } from '@/lib/tinode/connection'; import { loginErrorMessage, validateCredentialsMessage } from '@/lib/tinode/errors'; import { useSessionStore } from '@/stores/session'; @@ -25,7 +25,7 @@ export function LoginPage() { // eslint-disable-next-line react-hooks/exhaustive-deps }, [error]); - if (!tenant) { + if (!tenant || tenant.code !== FIXED_TENANT_CODE) { // Read tenant before touching getTinode() -- getTinode() lazily creates and PERMANENTLY caches // the singleton off whatever tenant is in the store at that moment (or a hardcoded fallback // host if there's none yet); calling it here first would risk creating that singleton against @@ -73,10 +73,7 @@ export function LoginPage() {