turnstile-caddy/challenge.html
Lukas Schaefer b8ab6783c8
All checks were successful
/ resolve-go (push) Successful in 4s
/ test (push) Successful in 6s
/ cleanup (push) Successful in 2s
Implement Authorization header support
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
2026-08-31 17:46:56 -04:00

85 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Security Checkpoint</title>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<style>
:root {
--bg: #121212;
--fg: #e8e8e8;
--muted: #9a9a9a;
--danger: #e07070;
--line: #2a2a2a;
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
display: grid;
align-content: center;
padding: 2rem;
background: var(--bg);
color: var(--fg);
font: 16px/1.5 ui-sans-serif, sans-serif;
}
main {
max-width: 22rem;
}
h1 {
margin: 0 0 0.5rem;
font-size: 1.25rem;
font-weight: 600;
}
.lede {
margin: 0 0 1.5rem;
color: var(--muted);
font-size: 0.95rem;
}
.widget {
padding-top: 1.25rem;
border-top: 1px solid var(--line);
}
.error {
margin: 1rem 0 0;
color: var(--danger);
font-size: 0.9rem;
}
</style>
</head>
<body>
<main>
<h1>Confirm you're human</h1>
<p class="lede">This path is not meant for public bots.</p>
<form id="captcha-form" method="POST" action="{{.VerifyPath}}">
<input type="hidden" name="redirect" value="{{.Redirect}}">
<div class="widget">
<div class="cf-turnstile"
data-sitekey="{{.SiteKey}}"
data-theme="dark"
data-callback="onTurnstileSuccess"
data-error-callback="onTurnstileError"></div>
</div>
{{if .Error}}
<p class="error">{{.Error}}</p>
{{end}}
</form>
</main>
<script>
function onTurnstileSuccess() {
setTimeout(function () {
document.getElementById('captcha-form').submit();
}, 250);
}
function onTurnstileError() {}
</script>
</body>
</html>