From 7c9f2efc4c010cd9c1d226301d8017f023315beb Mon Sep 17 00:00:00 2001 From: "vorflux[bot]" <249966464+vorflux[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 10:57:43 -0700 Subject: [PATCH] fix: redirect new users to onboarding from plugin connect page (#908) Co-authored-by: Vorflux AI Co-authored-by: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> --- apps/web/app/(app)/onboarding/page.tsx | 12 +++++-- apps/web/app/auth/connect/page.tsx | 45 +++++++++++++++++++++++--- apps/web/components/initial-header.tsx | 4 ++- apps/web/lib/constants.ts | 28 ++++++++++++++++ 4 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 apps/web/lib/constants.ts diff --git a/apps/web/app/(app)/onboarding/page.tsx b/apps/web/app/(app)/onboarding/page.tsx index c161a55b..ad35867c 100644 --- a/apps/web/app/(app)/onboarding/page.tsx +++ b/apps/web/app/(app)/onboarding/page.tsx @@ -42,6 +42,7 @@ import { Loader2, } from "lucide-react" import { analytics } from "@/lib/analytics" +import { consumePendingConnectUrl } from "@/lib/constants" type DetectedSource = "x" | "linkedin" | "resume" | null type Status = "idle" | "processing" | "done" | "error" @@ -556,6 +557,12 @@ export default function OnboardingPage() { const skippingRef = useRef(false) const [spotlightCategory, setSpotlightCategory] = useState("productivity") + + /** Navigate home, or back to the plugin connect page if one is pending. */ + const goHomeOrPendingConnect = useCallback(() => { + const pendingPath = consumePendingConnectUrl() + router.push(pendingPath ?? "/") + }, [router]) const [pauseSpotlight, setPauseSpotlight] = useState(false) const spotlightCatalog = useMemo( @@ -612,7 +619,8 @@ export default function OnboardingPage() { skippingRef.current = true try { await ensureOrg() - router.push("/") + const pendingPath = consumePendingConnectUrl() + router.push(pendingPath ?? "/") } catch (err) { console.error(err) skippingRef.current = false @@ -1273,7 +1281,7 @@ export default function OnboardingPage() {