Add callback for turnstile

This commit is contained in:
regalijan 2023-10-19 16:49:29 -04:00
parent d9bebf9a09
commit 96a4ba2b47
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -68,6 +68,10 @@ export default function () {
const { logged_in, site_key } = useLoaderData<typeof loader>();
function setToken(token: string) {
setTurnstileToken(token);
}
async function submit() {
const usernames = (
document.getElementById("usernames") as HTMLInputElement
@ -232,7 +236,11 @@ export default function () {
<input id="evidence" type="file" />
</FormControl>
<br />
<div className="cf-turnstile" data-sitekey={site_key}></div>
<div
className="cf-turnstile"
data-callback="setToken"
data-sitekey={site_key}
></div>
<br />
<Text>
By submitting this form, you agree to the{" "}