diff --git a/vibn-frontend/app/components/auth/AuthFlow.tsx b/vibn-frontend/app/components/auth/AuthFlow.tsx index a4edc5cc..1a9c88eb 100644 --- a/vibn-frontend/app/components/auth/AuthFlow.tsx +++ b/vibn-frontend/app/components/auth/AuthFlow.tsx @@ -12,9 +12,11 @@ function AuthFlowInner({ mode }: { mode: "signin" | "signup" }) { const [ssoProcessing, setSsoProcessing] = React.useState(false); const [ssoToken, setSsoToken] = React.useState(null); + const [routing, setRouting] = React.useState(false); useEffect(() => { if (status === "authenticated" && session?.user?.email) { + setRouting(true); const isVibnCodeSSO = searchParams?.get("vibncode") === "true"; if (isVibnCodeSSO) { @@ -65,7 +67,7 @@ function AuthFlowInner({ mode }: { mode: "signin" | "signup" }) { } }, [status, session, router, searchParams]); - if (status === "loading" || ssoProcessing) { + if (status === "loading" || ssoProcessing || routing) { return (