mirror of
https://github.com/ChatGPTNextWeb/NextChat.git
synced 2026-02-26 16:16:50 +08:00
feat: dynamic config
This commit is contained in:
@@ -32,7 +32,7 @@ export function middleware(req: NextRequest) {
|
||||
|
||||
// inject api key
|
||||
if (!token) {
|
||||
const apiKey = process.env.OPENAI_API_KEY;
|
||||
const apiKey = serverConfig.apiKey;
|
||||
if (apiKey) {
|
||||
console.log("[Auth] set system token");
|
||||
req.headers.set("token", apiKey);
|
||||
|
||||
Reference in New Issue
Block a user