This commit is contained in:
GH Action - Upstream Sync 2023-11-16 01:10:30 +00:00
commit e57e840d9d
1 changed files with 7 additions and 0 deletions

View File

@ -46,6 +46,13 @@ export function auth(req: NextRequest) {
};
}
if (serverConfig.hideUserApiKey && !!apiKey) {
return {
error: true,
msg: "you are not allowed to access openai with your own api key",
};
}
// if user does not provide an api key, inject system api key
if (!apiKey) {
const serverApiKey = serverConfig.isAzure