Merge remote

This commit is contained in:
Hk-Gosuto
2023-12-25 12:40:09 +08:00
parent da29a94714
commit fa2e046285
16 changed files with 47 additions and 31 deletions

View File

@@ -1,13 +1,14 @@
import { NextRequest, NextResponse } from "next/server";
import { auth } from "../../auth";
import S3FileStorage from "../../../utils/s3_file_storage";
import { ModelProvider } from "@/app/constant";
async function handle(req: NextRequest) {
if (req.method === "OPTIONS") {
return NextResponse.json({ body: "OK" }, { status: 200 });
}
const authResult = auth(req);
const authResult = auth(req, ModelProvider.GPT);
if (authResult.error) {
return NextResponse.json(authResult, {
status: 401,