mirror of
https://github.com/Such-Software/such.software.git
synced 2026-10-17 05:32:05 +02:00
fix turnstile
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
"test:ui": "playwright test --ui"
|
"test:ui": "playwright test --ui"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@marsidev/react-turnstile": "^1.0.2",
|
"@marsidev/react-turnstile": "^1.4.1",
|
||||||
"@repo/config": "workspace:*",
|
"@repo/config": "workspace:*",
|
||||||
"@repo/ui": "workspace:*",
|
"@repo/ui": "workspace:*",
|
||||||
"framer-motion": "^11.0.0",
|
"framer-motion": "^11.0.0",
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import { Turnstile } from '@marsidev/react-turnstile';
|
import { Turnstile } from '@marsidev/react-turnstile';
|
||||||
|
|
||||||
|
const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY;
|
||||||
|
|
||||||
export function TurnstileWidget({ onVerify }: { onVerify: (token: string) => void }) {
|
export function TurnstileWidget({ onVerify }: { onVerify: (token: string) => void }) {
|
||||||
|
if (!SITE_KEY) {
|
||||||
|
console.warn('NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Turnstile
|
<Turnstile
|
||||||
siteKey={process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY!}
|
siteKey={SITE_KEY}
|
||||||
onSuccess={onVerify}
|
onSuccess={onVerify}
|
||||||
options={{ theme: 'auto' }} // Matches our Light/Dark mode!
|
options={{ theme: 'auto' }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user