diff options
| author | Dhravya Shah <[email protected]> | 2024-07-25 17:35:15 -0500 |
|---|---|---|
| committer | Dhravya Shah <[email protected]> | 2024-07-25 17:35:15 -0500 |
| commit | c57719446ae95c2bbd432d7b2b6648a23b35c351 (patch) | |
| tree | c6f7aca777c7f4748cc6dc335fe56fba8725af02 /apps/web/app/(dash)/layout.tsx | |
| parent | add try catch in api/add for better error handling (diff) | |
| parent | ughh, regenerated migrations. my bad. (diff) | |
| download | supermemory-kush/experimental-thread.tar.xz supermemory-kush/experimental-thread.zip | |
solve merge conflictskush/experimental-thread
Diffstat (limited to 'apps/web/app/(dash)/layout.tsx')
| -rw-r--r-- | apps/web/app/(dash)/layout.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/web/app/(dash)/layout.tsx b/apps/web/app/(dash)/layout.tsx index b2b27a4f..c6174945 100644 --- a/apps/web/app/(dash)/layout.tsx +++ b/apps/web/app/(dash)/layout.tsx @@ -4,6 +4,7 @@ import { redirect } from "next/navigation"; import { auth } from "../../server/auth"; import { Toaster } from "@repo/ui/shadcn/sonner"; import BackgroundPlus from "../(landing)/GridPatterns/PlusGrid"; +import { getUser } from "../actions/fetchers"; async function Layout({ children }: { children: React.ReactNode }) { const info = await auth(); @@ -12,6 +13,13 @@ async function Layout({ children }: { children: React.ReactNode }) { return redirect("/signin"); } + const user = await getUser(); + const hasOnboarded = user.data?.hasOnboarded; + + if (!hasOnboarded) { + redirect("/onboarding"); + } + return ( <main className="h-screen flex flex-col"> <div className="fixed top-0 left-0 w-full z-40"> |