Files
thrilltrack-explorer/src/hooks/useCaptchaBypass.ts
2025-10-11 00:47:34 +00:00

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,
};
}