From 21f5a83edf9d9cb2affa4d76f8b848ef6b0e3784 Mon Sep 17 00:00:00 2001 From: Joseph J Helfenbein Date: Sat, 25 Jan 2025 03:41:37 -0500 Subject: [PATCH] fix --- src/app/api/webhook/route.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/api/webhook/route.js b/src/app/api/webhook/route.js index 54659ca..5f564cb 100644 --- a/src/app/api/webhook/route.js +++ b/src/app/api/webhook/route.js @@ -13,17 +13,18 @@ async function connectDB() { const CLERK_WEBHOOK_SECRET = process.env.CLERK_WEBHOOK_SECRET; -if (!CLERK_WEBHOOK_SECRET) { - console.error('CLERK_WEBHOOK_SECRET is missing'); - return NextResponse.json( - { message: 'Internal server error: Secret missing' }, - { status: 500 } - ); -} export async function POST(req) { console.log('Received request:', req); + if (!CLERK_WEBHOOK_SECRET) { + console.error('CLERK_WEBHOOK_SECRET is missing'); + return NextResponse.json( + { message: 'Internal server error: Secret missing' }, + { status: 500 } + ); + } + if (req.method !== 'POST') { return NextResponse.json( { message: 'Method Not Allowed' },