From 5be8bc10978ee23ac19c55c4899de3fe0decdcaa Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Tue, 24 Mar 2026 12:24:26 -0700 Subject: [PATCH 1/5] feat(home): auth-aware landing page navigation - Redirect authenticated users from / to /workspace via middleware (?home param bypasses) - Show "Go to App" instead of "Log in / Get started" in navbar for authenticated users - Logo links to /?home for authenticated users to stay in marketing context - Settings "Home Page" button opens /?home - Handle isPending session state to prevent CTA button flash --- .../app/(home)/components/navbar/navbar.tsx | 116 ++++++++++++------ apps/sim/app/(landing)/components/nav/nav.tsx | 107 ++++++++++------ .../settings/components/general/general.tsx | 2 +- apps/sim/proxy.ts | 6 +- 4 files changed, 151 insertions(+), 80 deletions(-) diff --git a/apps/sim/app/(home)/components/navbar/navbar.tsx b/apps/sim/app/(home)/components/navbar/navbar.tsx index 35cea4f68a7..20638b853c7 100644 --- a/apps/sim/app/(home)/components/navbar/navbar.tsx +++ b/apps/sim/app/(home)/components/navbar/navbar.tsx @@ -5,6 +5,7 @@ import Image from 'next/image' import Link from 'next/link' import { GithubOutlineIcon } from '@/components/icons' import { cn } from '@/lib/core/utils/cn' +import { useSession } from '@/lib/auth/auth-client' import { BlogDropdown, type NavBlogPost, @@ -40,6 +41,9 @@ interface NavbarProps { export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps) { const brand = getBrandConfig() + const { data: session, isPending: isSessionPending } = useSession() + const isAuthenticated = Boolean(session?.user?.id) + const logoHref = isAuthenticated ? '/?home' : '/' const [activeDropdown, setActiveDropdown] = useState(null) const [hoveredLink, setHoveredLink] = useState(null) const [mobileMenuOpen, setMobileMenuOpen] = useState(false) @@ -92,7 +96,7 @@ export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps itemScope itemType='https://schema.org/SiteNavigationElement' > - + {brand.name} @@ -121,7 +125,11 @@ export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps {!logoOnly && ( <>