Really test out the key

This commit is contained in:
Jared Palmer 2023-06-16 16:32:19 -04:00
parent c040a5c425
commit d1b8f16261

View file

@ -8,9 +8,11 @@ import { nanoid } from '@/lib/utils'
export const runtime = 'edge' export const runtime = 'edge'
export async function POST(req: Request) { export async function POST(req: Request) {
const session = await auth() if (process.env.VERCEL_ENV !== 'preview') {
if (session == null) { const session = await auth()
return new Response('Unauthorized', { status: 401 }) if (session == null) {
return new Response('Unauthorized', { status: 401 })
}
} }
const json = await req.json() const json = await req.json()