cobalt / web /src /lib /api /turnstile.ts
playingapi's picture
Upload 376 files
43a06dc verified
raw
history blame contribute delete
574 Bytes
import { turnstileSolved } from "$lib/state/turnstile";
const getResponse = () => {
const turnstileElement = document.getElementById("turnstile-widget");
if (turnstileElement) {
return window?.turnstile?.getResponse(turnstileElement);
}
return null;
}
const reset = () => {
const turnstileElement = document.getElementById("turnstile-widget");
if (turnstileElement) {
turnstileSolved.set(false);
return window?.turnstile?.reset(turnstileElement);
}
return null;
}
export default {
getResponse,
reset,
}