Only ask for tokens on preview
This commit is contained in:
parent
b5f61e75f2
commit
9d63e761a8
1 changed files with 1 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ export async function POST(req: Request) {
|
||||||
const { messages, previewToken } = json
|
const { messages, previewToken } = json
|
||||||
const session = await auth()
|
const session = await auth()
|
||||||
|
|
||||||
if (process.env.VERCEL_ENV !== 'preview') {
|
if (process.env.VERCEL_ENV === 'preview') {
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
return new Response('Unauthorized', { status: 401 })
|
return new Response('Unauthorized', { status: 401 })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue