diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4509fda..13217b3 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -297,7 +297,12 @@ const AppContent: React.FC = () => { : currentHostname; const isRootDomainForUnauthUser = currentHostname === baseDomain || currentHostname === 'localhost'; - if (!isRootDomainForUnauthUser) { + // Don't redirect for certain public paths that should work on any subdomain + const publicPaths = ['/accept-invite', '/verify-email', '/tenant-onboard']; + const currentPath = window.location.pathname; + const isPublicPath = publicPaths.some(path => currentPath.startsWith(path)); + + if (!isRootDomainForUnauthUser && !isPublicPath) { // Redirect to root domain login (preserve port) const protocol = window.location.protocol; const port = window.location.port ? `:${window.location.port}` : '';