proper user/session creation and auth integration into UI
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { auth } from "@/auth";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user) {
|
||||
return NextResponse.json(
|
||||
{ error: "Authentication required" },
|
||||
{ status: 401 }
|
||||
);
|
||||
}
|
||||
|
||||
const { prompt } = await request.json();
|
||||
|
||||
const systemPrompt = `
|
||||
|
||||
Reference in New Issue
Block a user