Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensigo committed Oct 12, 2023
1 parent 31e2d56 commit 5a759f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const env = createEnv({
*/
server: {
DATABASE_URL: z.string().url(),
// DIRECT_DATABASE_URL: z.string().url(),
DIRECT_DATABASE_URL: z.string().url(),
NODE_ENV: z.enum(["development", "test", "production"]),
NEXTAUTH_SECRET:
process.env.NODE_ENV === "production"
Expand Down
15 changes: 7 additions & 8 deletions src/pages/api/v2/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { withAccelerate } from '@prisma/extension-accelerate';
import { OpenAIStream, StreamingTextResponse } from 'ai'
import { Configuration, OpenAIApi } from 'openai-edge'
import { env } from "@/env.mjs";
import { auth } from "../auth/[...nextauth]";



Expand All @@ -20,14 +19,14 @@ export default async function POST(req: Request) {

// handle auth
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const session = req.headers.getSetCookie()
// const session = req.headers.getSetCookie()

console.log({ session })
if (!session){
return new Response('Unauthorized', {
status: 401
})
}
// console.log({ session })
// if (!session){
// return new Response('Unauthorized', {
// status: 401
// })
// }


const prisma = new PrismaClient().$extends(withAccelerate());
Expand Down

0 comments on commit 5a759f5

Please sign in to comment.