From a8d176b4ecafbe9ad49830c83c3cd220e1c12ddc Mon Sep 17 00:00:00 2001 From: poduck Date: Sat, 20 Dec 2025 11:47:22 -0500 Subject: [PATCH] Fix: Redirect business users from platform subdomain to their business subdomain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a business user (owner, staff, resource) ended up on the platform subdomain (e.g., via stale tokens or direct URL access), they would fall through to business routes and see the PublicPage ("Schedule Your Appointment") instead of being redirected to their proper business subdomain. Added redirect rule for business users on platform subdomain to redirect them to their business subdomain, matching the existing behavior for customers on platform subdomain. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- frontend/src/App.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 8faabac5..a1347b5a 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -463,6 +463,13 @@ const AppContent: React.FC = () => { return ; } + // RULE: Business users on platform subdomain should be redirected to their business subdomain + if (isBusinessUser && isPlatformDomain && user.business_subdomain) { + const port = window.location.port ? `:${window.location.port}` : ''; + window.location.href = `${protocol}//${user.business_subdomain}.${baseDomain}${port}/`; + return ; + } + // RULE: Business users must be on their own business subdomain if (isBusinessUser && isBusinessSubdomain && user.business_subdomain && user.business_subdomain !== currentSubdomain) { const port = window.location.port ? `:${window.location.port}` : '';