fix(web): redirect authenticated admin users to /admin #235

Merged
groombook-engineer[bot] merged 2 commits from fix/gro-488-admin-login-redirect into main 2026-04-05 21:35:06 +00:00
+6
View File
@@ -262,6 +262,12 @@ export function App() {
return <Navigate to="/setup" replace />;
}
// 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 <Navigate to="/admin" replace />;
}
// Don't render portal chrome at /login — DevLoginSelector is shown instead
const showCustomerPortal = !location.pathname.startsWith("/admin") && location.pathname !== "/login";