From 434fcec8c796e952724195a05db07fed2abacdce Mon Sep 17 00:00:00 2001 From: bensigo Date: Tue, 10 Oct 2023 20:52:50 +0400 Subject: [PATCH] refactor: uncomment importatnt code --- src/pages/api/v2/chat.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/api/v2/chat.ts b/src/pages/api/v2/chat.ts index 805a26b..31158e0 100644 --- a/src/pages/api/v2/chat.ts +++ b/src/pages/api/v2/chat.ts @@ -45,11 +45,11 @@ export default async function POST(req: NextApiRequest, res: NextApiResponse) { } - // const isValidChatSession = isValidSession(dailySession) - // if (!isValidChatSession){ - // res.status(400).send("Expired session") - // return; - // } + const isValidChatSession = isValidSession(dailySession) + if (!isValidChatSession){ + res.status(400).send("Expired session") + return; + } const response = await openai.createChatCompletion({ stream: true,