diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index fe2b0247..da045454 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -175,36 +175,41 @@ function App() { } /> {/* Customer surface (#354). Strictly separate provider / - cookie / API surface from /admin/*. Gated by the - customerPortal feature flag — when off, all - /customer/* URLs redirect to /admin/dashboard. */} - }> - - - {/* Public surfaces: login, accept-invite, reset — - no CustomerLayout (their own branded shells). */} - } /> - } /> - } /> + cookie / API surface from /admin/*. The customerPortal + feature flag hides the *admin-side* surfaces (sidebar + entry, /admin/customers routes, CustomerAccountPicker) + via RequireFeature. The customer-side /customer/* + tree stays publicly reachable so existing customers + can still log in even if the admin temporarily flips + the flag off — and because RequireFeature reads from + FeatureFlagsProvider (admin-only context), gating + these routes here would crash unauthenticated + visitors with an unmounted-provider error. */} + + + {/* Public surfaces: login, accept-invite, reset — + no CustomerLayout (their own branded shells). */} + } /> + } /> + } /> - {/* Authenticated surfaces share the sidebar layout - (Outlet pattern, mirrors AdminLayout). The - CustomerLayout itself enforces auth — bouncing - unauthenticated visitors to /customer/login. */} - }> - } /> - } /> - } /> - } /> - } /> - + {/* Authenticated surfaces share the sidebar layout + (Outlet pattern, mirrors AdminLayout). The + CustomerLayout itself enforces auth — bouncing + unauthenticated visitors to /customer/login. */} + }> + } /> + } /> + } /> + } /> + } /> + - } /> - - - } /> - + } /> + + + } /> {/* Public legal pages */} } />