This commit is contained in:
GH Action - Upstream Sync 2023-11-15 18:00:54 +00:00
commit d4693a53e9

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