Revert the public /LandingPage route

Rolls src/App.jsx back to 3c649fc, so every route including /LandingPage sits
behind the Base44 auth gate again. Reverts:

  015da4e  Render the landing page without a Base44 session

Completes the rollback of the public-without-login routes; the blank-page fix
in 3c649fc is left in place, since that is what makes the deploy render at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-17 20:58:23 +05:30
parent 0ddbd35c8b
commit a51ab4ade8

View File

@@ -50,34 +50,10 @@ const LayoutWrapper = ({ children, currentPageName }) => Layout ?
<Layout currentPageName={currentPageName}>{children}</Layout> <Layout currentPageName={currentPageName}>{children}</Layout>
: <>{children}</>; : <>{children}</>;
// Routes that render for anyone, signed in or not. LandingPage is pure marketing
// markup — it reads no entities and never touches useAuth — so the only thing the
// auth gate ever did for it was bounce visitors to a Google login before they
// could read what the product is. Its CTAs point at /Dashboard, which is still
// gated, so signing in stays one click away.
const PUBLIC_ROUTES = new Set(['/LandingPage']);
const isPublicRoute = (pathname) => {
// Tolerate a trailing slash so /LandingPage/ isn't quietly sent to login.
const normalized = pathname.length > 1 ? pathname.replace(/\/+$/, '') : pathname;
return PUBLIC_ROUTES.has(normalized);
};
const AuthenticatedApp = () => { const AuthenticatedApp = () => {
const { isLoadingAuth, isLoadingPublicSettings, authError, isAuthenticated, navigateToLogin } = useAuth(); const { isLoadingAuth, isLoadingPublicSettings, authError, isAuthenticated, navigateToLogin } = useAuth();
const location = useLocation(); const location = useLocation();
// Ahead of both gates below. The spinner would stall this page on a network
// round-trip it has no use for, and the auth gate would redirect away from it —
// either one defeats the point of a public page.
if (isPublicRoute(location.pathname)) {
return (
<Routes>
<Route path="/LandingPage" element={<LandingPage />} />
</Routes>
);
}
// Show loading spinner while checking app public settings or auth // Show loading spinner while checking app public settings or auth
if (isLoadingPublicSettings || isLoadingAuth) { if (isLoadingPublicSettings || isLoadingAuth) {
return ( return (
@@ -116,6 +92,14 @@ const AuthenticatedApp = () => {
// Render the main app // Render the main app
if (location.pathname === '/LandingPage') {
return (
<Routes>
<Route path="/LandingPage" element={<LandingPage />} />
</Routes>
);
}
return ( return (
<LayoutWrapper currentPageName={mainPageKey}> <LayoutWrapper currentPageName={mainPageKey}>
<Routes> <Routes>