diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index b0ac1c7..8e8c79e 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -262,6 +262,12 @@ export function App() { return ; } + // Redirect authenticated users to /admin (but preserve impersonation flow via ?sessionId=) + const searchParams = new URLSearchParams(location.search); + if (!authDisabled && session && !location.pathname.startsWith("/admin") && !searchParams.has("sessionId")) { + return ; + } + // Don't render portal chrome at /login — DevLoginSelector is shown instead const showCustomerPortal = !location.pathname.startsWith("/admin") && location.pathname !== "/login";