diff --git a/next.config.ts b/next.config.ts index 6fded8b..437d8b4 100644 --- a/next.config.ts +++ b/next.config.ts @@ -3,7 +3,6 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { transpilePackages: ['@tldraw/tldraw'], output: 'export', - trailingSlash: true, eslint: { ignoreDuringBuilds: true }, typescript: { ignoreBuildErrors: true }, webpack: (config, { isServer }) => { diff --git a/src/app/project-builder/page.tsx b/src/app/project-builder/page.tsx index 46beb18..99393ab 100644 --- a/src/app/project-builder/page.tsx +++ b/src/app/project-builder/page.tsx @@ -1,7 +1,26 @@ -import { Suspense } from "react" +"use client" + +import { Suspense, useEffect } from "react" +import { useRouter } from "next/navigation" import { MainDashboard } from "@/components/main-dashboard" +import { useAuth } from "@/contexts/auth-context" export default function ProjectBuilderPage() { + const router = useRouter() + const { user, isLoading } = useAuth() + + useEffect(() => { + if (isLoading) return + if (!user) { + const returnUrl = encodeURIComponent("/project-builder") + router.replace(`/signin?returnUrl=${returnUrl}`) + } + }, [user, isLoading, router]) + + if (isLoading || !user) { + return