proper user/session creation and auth integration into UI
This commit is contained in:
1 parent
1a13013b45
commit
12e9ec5d85
12 files changed
+726
-94
No files matched your search
@@ -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