Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add callback for turnstile
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent d9bebf9 commit 96a4ba2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/routes/report.tsx
Expand Up @@ -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
Expand Down Expand Up @@ -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{" "}
Expand Down

0 comments on commit 96a4ba2

Please sign in to comment.