fix: update encryption key retrieval to use only USER_API_KEYS_ENCRYPTION_SECRET; remove supabase secret key fallback

This commit is contained in:
willchen96 2026-05-16 00:53:14 +08:00
parent 4290104cd0
commit b4ba274264

View file

@ -37,12 +37,9 @@ export function hasEnvApiKey(provider: ApiKeyProvider): boolean {
}
function encryptionKey(): Buffer {
const secret =
process.env.USER_API_KEYS_ENCRYPTION_SECRET ||
process.env.API_KEYS_ENCRYPTION_SECRET ||
process.env.SUPABASE_SECRET_KEY;
const secret = process.env.USER_API_KEYS_ENCRYPTION_SECRET;
if (!secret) {
throw new Error("API key encryption secret is not configured");
throw new Error("USER_API_KEYS_ENCRYPTION_SECRET is not configured");
}
return crypto.createHash("sha256").update(secret).digest();
}