diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx new file mode 100644 index 0000000..497583f --- /dev/null +++ b/src/app/dashboard/layout.tsx @@ -0,0 +1,28 @@ +import { redirect } from 'next/navigation' +import { createClient } from '@/lib/supabase/server' +import Navbar from '@/components/Navbar' + +export default async function DashboardLayout({ + children, +}: { + children: React.ReactNode +}) { + const supabase = await createClient() + + const { + data: { user }, + } = await supabase.auth.getUser() + + if (!user) { + redirect('/login') + } + + return ( +