ai generated solutions to our ai generated problems

This commit is contained in:
2026-06-20 00:32:28 +01:00
parent f631ea12a8
commit 152467515d
4 changed files with 18 additions and 6 deletions
-6
View File
@@ -2,12 +2,6 @@
<html lang="en">
<head>
<title>__SEO_TITLE__</title>
<link rel="preconnect" href="https://challenges.cloudflare.com" />
<script
src="https://challenges.cloudflare.com/turnstile/v0/api.js"
async
defer>
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+16
View File
@@ -50,6 +50,7 @@ const liveRefreshMs = 15000
const siteVersion = '1.0.1'
const turnstileSiteKey = import.meta.env.VITE_TURNSTILE_SITE_KEY || ''
const siteGateEnabled = String(import.meta.env.VITE_SITE_GATE || 'false').toLowerCase() === 'true'
const staticDataBase = (import.meta.env.VITE_STATIC_DATA_BASE || '/data').replace(/\/+$/, '')
const staticDataEnabled = String(import.meta.env.VITE_STATIC_DATA || 'true').toLowerCase() !== 'false'
const missingStaticDataPaths = new Set()
@@ -901,6 +902,16 @@ function TurnstileWidget({ siteKey, theme = 'auto', size = 'normal', action, onV
let cancelled = false
let pollTimer
let script = document.querySelector('script[data-tss-turnstile]')
if (!script) {
script = document.createElement('script')
script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js'
script.async = true
script.defer = true
script.dataset.tssTurnstile = 'true'
document.head.appendChild(script)
}
const renderWidget = () => {
if (cancelled) return
@@ -1019,6 +1030,11 @@ function SiteGate({ onVerified }) {
}
function App() {
if (!siteGateEnabled) return <AppContent />
return <GatedAppContent />
}
function GatedAppContent() {
const embeddedGateState = document
.querySelector('meta[name="tss-turnstile-session"]')
?.getAttribute('content')