mirror of
https://github.com/sqlchat/sqlchat.git
synced 2026-03-13 07:59:44 +08:00
chore: remove openai api key check temporarily
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
import {
|
||||
createParser,
|
||||
ParsedEvent,
|
||||
ReconnectInterval,
|
||||
} from "eventsource-parser";
|
||||
import { createParser, ParsedEvent, ReconnectInterval } from "eventsource-parser";
|
||||
import { NextRequest } from "next/server";
|
||||
import { API_KEY } from "@/env";
|
||||
import { openAIApiEndpoint, openAIApiKey, gpt35 } from "@/utils";
|
||||
|
||||
export const config = {
|
||||
@@ -18,15 +13,6 @@ const getApiEndpoint = (apiEndpoint: string) => {
|
||||
};
|
||||
|
||||
const handler = async (req: NextRequest) => {
|
||||
if (API_KEY) {
|
||||
const auth = req.headers.get("Authorization");
|
||||
if (!auth || auth !== `Bearer ${API_KEY}`) {
|
||||
return new Response("Unauthorized", {
|
||||
status: 401,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const reqBody = await req.json();
|
||||
const openAIApiConfig = reqBody.openAIApiConfig;
|
||||
const apiKey = openAIApiConfig?.key || openAIApiKey;
|
||||
|
||||
Reference in New Issue
Block a user