From 55983d786c8b48be50163b09a286932b386f42a3 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Wed, 26 Jun 2024 14:38:21 +0200 Subject: [PATCH] feat: attempt to register new user --- app/api/register/route.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 }); -} +});