mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 17:44:57 +08:00
feat: #1640 support free gpt endpoint
This commit is contained in:
@@ -2,6 +2,7 @@ import { NextRequest } from "next/server";
|
||||
import { getServerSideConfig } from "../config/server";
|
||||
import md5 from "spark-md5";
|
||||
import { ACCESS_CODE_PREFIX } from "../constant";
|
||||
import { OPENAI_URL } from "./common";
|
||||
|
||||
function getIP(req: NextRequest) {
|
||||
let ip = req.ip ?? req.headers.get("x-real-ip");
|
||||
@@ -55,7 +56,7 @@ export function auth(req: NextRequest) {
|
||||
} else {
|
||||
console.log("[Auth] admin did not provide an api key");
|
||||
return {
|
||||
error: true,
|
||||
error: serverConfig.baseUrl?.includes(OPENAI_URL),
|
||||
msg: "admin did not provide an api key",
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user