AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(turnstile): Disable turnstile by default and rename its env (#10129)
Bently6771476d01d6
diff --git a/autogpt_platform/frontend/.env.example b/autogpt_platform/frontend/.env.exampleindex 04e3831b6c..e3763c1da0 100644--- a/autogpt_platform/frontend/.env.example+++ b/autogpt_platform/frontend/.env.example@@ -32,4 +32,4 @@ NEXT_PUBLIC_SHOW_BILLING_PAGE=false## Get these from the Cloudflare Turnstile dashboard: https://dash.cloudflare.com/?to=/:account/turnstile## This is the frontend site keyNEXT_PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY=-NEXT_PUBLIC_DISABLE_TURNSTILE=false+NEXT_PUBLIC_TURNSTILE=disableddiff --git a/autogpt_platform/frontend/src/hooks/useTurnstile.ts b/autogpt_platform/frontend/src/hooks/useTurnstile.tsindex 833fb723ad..d07cbaf573 100644--- a/autogpt_platform/frontend/src/hooks/useTurnstile.ts+++ b/autogpt_platform/frontend/src/hooks/useTurnstile.ts@@ -47,8 +47,7 @@ export function useTurnstile({useEffect(() => {const behaveAs = getBehaveAs();const hasTurnstileKey = !!TURNSTILE_SITE_KEY;- const turnstileDisabled =- process.env.NEXT_PUBLIC_DISABLE_TURNSTILE === "true";+ const turnstileDisabled = process.env.NEXT_PUBLIC_TURNSTILE !== "enabled";// Only render Turnstile in cloud environment if not explicitly disabledsetShouldRender(diff --git a/autogpt_platform/frontend/src/lib/turnstile.ts b/autogpt_platform/frontend/src/lib/turnstile.tsindex 47194ae627..35f5b1e271 100644--- a/autogpt_platform/frontend/src/lib/turnstile.ts+++ b/autogpt_platform/frontend/src/lib/turnstile.ts@@ -7,8 +7,8 @@ export async function verifyTurnstileToken(token: string,action?: string,): Promise<boolean> {- // Skip verification if explicitly disabled via environment variable- if (process.env.NEXT_PUBLIC_DISABLE_TURNSTILE === "true") {+ // Skip verification unless explicitly enabled via environment variable+ if (process.env.NEXT_PUBLIC_TURNSTILE !== "enabled") {return true;}