fix(turnstile): conditionally include secretKey in Turnstile configuration based on management permissions

This commit is contained in:
beilunyang
2025-10-22 23:37:52 +08:00
parent e431c1fe5b
commit d21f8c6b42

View File

@@ -32,11 +32,11 @@ export async function GET() {
emailDomains: emailDomains || "moemail.app",
adminContact: adminContact || "",
maxEmails: maxEmails || EMAIL_CONFIG.MAX_ACTIVE_EMAILS.toString(),
turnstile: {
turnstile: canManageConfig ? {
enabled: turnstileEnabled === "true",
siteKey: turnstileSiteKey || "",
...(canManageConfig ? { secretKey: turnstileSecretKey || "" } : {})
}
secretKey: turnstileSecretKey || "",
} : undefined
})
}