From 9729e2d8a0846972d1643842999fbc6126816c9e Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Tue, 4 Feb 2025 13:51:56 +0800 Subject: [PATCH] feat(dashboard): add user authentication and integrate CreateWorkspaceForm --- src/app/dashboard/page.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 10d53d2..dc62b14 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,12 +1,15 @@ -export default function DashboardPage() { +import { redirect } from "next/navigation"; +import { getCurrent } from "@/features/auth/actions"; +import { CreateWorkspaceForm } from "@/features/workspaces/components/create-workspace-form"; + +export default async function DashboardPage() { + const user = await getCurrent(); + + if (!user) redirect("/sign-in"); + return ( -
-
-
-
-
-
-
+
+
); }