diff --git a/app/api/register/route.ts b/app/api/register/route.ts index b6dc010..a5d2c17 100644 --- a/app/api/register/route.ts +++ b/app/api/register/route.ts @@ -1,7 +1,12 @@ +import { getSession, withApiAuthRequired } from '@auth0/nextjs-auth0'; import prisma from '@prisma/prisma'; import { NextRequest, NextResponse } from 'next/server'; -export async function POST(request: NextRequest) { +export const POST = withApiAuthRequired(async (request: NextRequest) => { + const session = await getSession(); + + console.log('Session', session); + const body = await request.json(); console.log('request', request, 'body', body); @@ -23,4 +28,4 @@ export async function POST(request: NextRequest) { } return NextResponse.json({ message: email }); -} +});