mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 10:11:13 -05:00
24 lines
728 B
TypeScript
24 lines
728 B
TypeScript
import { useEffect } from 'react';
|
|
|
|
export function useCaptchaBypass() {
|
|
// Single layer: Check if environment allows bypass
|
|
const bypassEnabled = import.meta.env.VITE_ALLOW_CAPTCHA_BYPASS === 'true';
|
|
|
|
// Log warning if bypass is active
|
|
useEffect(() => {
|
|
if (bypassEnabled && typeof window !== 'undefined') {
|
|
console.warn(
|
|
'⚠️ CAPTCHA BYPASS IS ACTIVE\n' +
|
|
'CAPTCHA verification is disabled via VITE_ALLOW_CAPTCHA_BYPASS=true\n' +
|
|
'This should ONLY be enabled in development/preview environments.\n' +
|
|
'Ensure VITE_ALLOW_CAPTCHA_BYPASS=false in production!'
|
|
);
|
|
}
|
|
}, [bypassEnabled]);
|
|
|
|
return {
|
|
bypassEnabled,
|
|
requireCaptcha: !bypassEnabled,
|
|
};
|
|
}
|