mirror of
https://github.com/willchen96/mike.git
synced 2026-06-08 20:25:13 +02:00
Merge pull request #137 from willchen96/require-user-api-key-secret
fix: update encryption key retrieval to use only USER_API_KEYS_ENCRYPTION_SECRET
This commit is contained in:
commit
aed8c42e94
1 changed files with 2 additions and 5 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue