import FetchDataSteps from "@/app/_components/tutorial/fetch-data-steps"; import db from "@/lib/db"; import { createClient } from "@/utils/supabase/server"; import { InfoIcon } from "lucide-react"; import { redirect } from "next/navigation"; export default async function ProtectedPage() { const supabase = await createClient(); const { data: { user }, } = await supabase.auth.getUser(); if (!user) { return redirect("/sign-in"); } const userDetail = await db.users.findUnique({ where: { id: user.id, }, }); return (
This is a protected page that you can only see as an authenticated user

Your user details

          {JSON.stringify(userDetail, null, 2)}
        
          {JSON.stringify(user, null, 2)}
        

Next steps

); }