diff --git a/app/customer-form/[id]/page.tsx b/app/customer-form/[id]/page.tsx index cf59c61..60ac6b4 100644 --- a/app/customer-form/[id]/page.tsx +++ b/app/customer-form/[id]/page.tsx @@ -1,10 +1,11 @@ 'use client'; +import { withPageAuthRequired } from '@auth0/nextjs-auth0/client'; import { CustomerForm, CustomerFormSchema } from '@utils/types'; import axios from 'axios'; import { useEffect, useState } from 'react'; -export default function SingleCustomerForm({ +export default withPageAuthRequired(function SingleCustomerForm({ params }: { params: { id: string }; @@ -39,4 +40,4 @@ export default function SingleCustomerForm({ Form {params.id} {JSON.stringify(customerForm)} ); -} +}); diff --git a/app/customer-form/page.tsx b/app/customer-form/page.tsx index d1ec6a3..39b5f60 100644 --- a/app/customer-form/page.tsx +++ b/app/customer-form/page.tsx @@ -1,5 +1,6 @@ 'use client'; +import { withPageAuthRequired } from '@auth0/nextjs-auth0/client'; import { Button } from '@components/Button'; import { FormControl } from '@components/FormControl'; import { FormMessage } from '@components/FormMessage'; @@ -20,7 +21,7 @@ import { useRouter } from 'next/navigation'; import { useEffect, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; -export default function CustomerForms() { +export default withPageAuthRequired(function CustomerForms() { const router = useRouter(); const [customerForms, setCustomerForms] = useState([]); @@ -116,4 +117,4 @@ export default function CustomerForms() { ); -} +});