Skip to content

Commit cd3cb87

Browse files
TheodoreSpeaksTheodore Li
andauthored
fix(signup): fix turnstile key loading (#4021)
Co-authored-by: Theodore Li <theo@sim.ai>
1 parent 762fbbd commit cd3cb87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/sim/app/(auth)/signup/signup-form.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ function SignupFormContent({
9999
const [showEmailValidationError, setShowEmailValidationError] = useState(false)
100100
const [formError, setFormError] = useState<string | null>(null)
101101
const turnstileRef = useRef<TurnstileInstance>(null)
102-
const turnstileSiteKey = useMemo(() => getEnv('NEXT_PUBLIC_TURNSTILE_SITE_KEY'), [])
102+
const [turnstileSiteKey, setTurnstileSiteKey] = useState<string | undefined>()
103+
104+
useEffect(() => {
105+
setTurnstileSiteKey(getEnv('NEXT_PUBLIC_TURNSTILE_SITE_KEY'))
106+
}, [])
103107
const redirectUrl = useMemo(
104108
() => searchParams.get('redirect') || searchParams.get('callbackUrl') || '',
105109
[searchParams]

0 commit comments

Comments
 (0)