From 9d63e761a8774db3bc8dc5656bae33fa9ddb265e Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Wed, 21 Jun 2023 14:01:05 -0700 Subject: [PATCH] Only ask for tokens on preview --- app/api/chat/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 3a9f472..b39b26c 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -18,7 +18,7 @@ export async function POST(req: Request) { const { messages, previewToken } = json const session = await auth() - if (process.env.VERCEL_ENV !== 'preview') { + if (process.env.VERCEL_ENV === 'preview') { if (session == null) { return new Response('Unauthorized', { status: 401 }) }