Security audit #1

This commit is contained in:
Joey Yakimowich-Payne 2026-02-03 06:59:07 -07:00
commit cd04d34b23
8 changed files with 131 additions and 56 deletions

View file

@ -4,11 +4,10 @@ import { buildQuizPrompt, JSON_EXAMPLE_GUIDANCE } from "../server/src/shared/qui
import { v4 as uuidv4 } from 'uuid';
const getGeminiClient = (apiKey?: string) => {
const key = apiKey || process.env.API_KEY;
if (!key) {
throw new Error("Gemini API key is missing");
if (!apiKey) {
throw new Error("Gemini API key is required. Use your own API key or enable System AI.");
}
return new GoogleGenAI({ apiKey: key });
return new GoogleGenAI({ apiKey });
};
const DEFAULT_GEMINI_MODEL = 'gemini-3-flash-preview';