File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ export default function AppHelmet() {
2222 if (
2323 location . pathname . startsWith ( '/tempPassword' ) ||
2424 location . pathname . startsWith ( '/resetPassword' ) ||
25- location . pathname === '/register'
25+ location . pathname === '/register' ||
26+ location . pathname === '/turnstile'
2627 ) {
2728 return ;
2829 } else {
Original file line number Diff line number Diff line change 11import { useEffect , useRef } from 'react' ;
2+ import { useSearchParams } from 'react-router-dom' ;
23
3- const SITE_KEY = import . meta. env . VITE_TURNSTILE_SITE_KEY as string ;
4+ const DEFAULT_SITE_KEY = import . meta. env . VITE_TURNSTILE_SITE_KEY as string ;
45
56declare global {
67 interface Window {
@@ -11,6 +12,10 @@ declare global {
1112
1213export default function TurnstileBridge ( ) {
1314 const containerRef = useRef < HTMLDivElement | null > ( null ) ;
15+ const [ searchParams ] = useSearchParams ( ) ;
16+
17+ // Получаем sitekey из URL параметров или используем значение по умолчанию
18+ const siteKey = searchParams . get ( 'sitekey' ) || DEFAULT_SITE_KEY ;
1419
1520 useEffect ( ( ) => {
1621 const script = document . createElement ( 'script' ) ;
@@ -36,7 +41,7 @@ export default function TurnstileBridge() {
3641
3742 if ( containerRef . current && ts ) {
3843 ts . render ( containerRef . current , {
39- sitekey : SITE_KEY ,
44+ sitekey : siteKey ,
4045 callback : ( token : string ) => {
4146 window . location . href =
4247 'ethoraappreactnative://turnstile?token=' +
You can’t perform that action at this time.
0 commit comments