mirror of
https://github.com/beilunyang/moemail.git
synced 2026-09-07 08:16:37 +08:00
fix(turnstile): conditionally include secretKey in Turnstile configuration based on management permissions
This commit is contained in:
@@ -32,11 +32,11 @@ export async function GET() {
|
|||||||
emailDomains: emailDomains || "moemail.app",
|
emailDomains: emailDomains || "moemail.app",
|
||||||
adminContact: adminContact || "",
|
adminContact: adminContact || "",
|
||||||
maxEmails: maxEmails || EMAIL_CONFIG.MAX_ACTIVE_EMAILS.toString(),
|
maxEmails: maxEmails || EMAIL_CONFIG.MAX_ACTIVE_EMAILS.toString(),
|
||||||
turnstile: {
|
turnstile: canManageConfig ? {
|
||||||
enabled: turnstileEnabled === "true",
|
enabled: turnstileEnabled === "true",
|
||||||
siteKey: turnstileSiteKey || "",
|
siteKey: turnstileSiteKey || "",
|
||||||
...(canManageConfig ? { secretKey: turnstileSecretKey || "" } : {})
|
secretKey: turnstileSecretKey || "",
|
||||||
}
|
} : undefined
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user