diff --git a/web/src/features/auth/RegisterPage.tsx b/web/src/features/auth/RegisterPage.tsx index 9f276785..60d357c1 100644 --- a/web/src/features/auth/RegisterPage.tsx +++ b/web/src/features/auth/RegisterPage.tsx @@ -6,7 +6,7 @@ import { Icon } from '@/app/Icon'; import { PasswordInput } from '@/features/auth/components/PasswordInput'; import { VerificationCodeButton } from '@/features/auth/components/VerificationCodeButton'; import { verifyRegistrationCode } from '@/lib/api/auth'; -import { apiBase, ImApiError } from '@/lib/api/client'; +import { fileBase, ImApiError } from '@/lib/api/client'; import { getTinode, registerBasic } from '@/lib/tinode/connection'; import { loginErrorMessage, validateCredentialsMessage } from '@/lib/tinode/errors'; import { useSessionStore } from '@/stores/session'; @@ -38,7 +38,9 @@ export function RegisterPage() { if (!tenant) return ; const minPasswordLength = tenant.passwordPolicy?.minLength ?? 8; - const legalOrigin = new URL(apiBase(), window.location.href).origin; + // The deployed file endpoint is pinned to the IM API host; the web host serves + // unknown /legal/* paths as the SPA index instead of the actual agreements. + const legalOrigin = new URL(fileBase(), window.location.href).origin; const submit = async (event: React.FormEvent) => { event.preventDefault();