How to reset turnstile widget?

Currently for every callback that is not success one I ran a function that basically informs the user they need to reload the page or use other ways to perform the action because they are not passing the challenge. But there is this expired callback that I'm assuming fires after a challenge is completed successfully but it expires (It must be because my widget is invisible), so what I want to know is how do I do to reset the challenge in this case so the user doesn't have to reload the page? Is there a function? I trying looking for info but found nothing. Thank you.
1 Reply
i.wont.tell
i.wont.tellOP8mo ago
so should I not be assigning any function? I currently have it like this:
turnstile.ready(function () {
turnstile.render(".widget", {
sitekey: "xxxxxxxxxxxxxxxxxxxx",
callback: turnstileSuccess,
"error-callback": turnstileError,
"expired-callback": turnstileError,
"timeout-callback": turnstileError,
"unsupported-callback": turnstileError,
});
});
turnstile.ready(function () {
turnstile.render(".widget", {
sitekey: "xxxxxxxxxxxxxxxxxxxx",
callback: turnstileSuccess,
"error-callback": turnstileError,
"expired-callback": turnstileError,
"timeout-callback": turnstileError,
"unsupported-callback": turnstileError,
});
});
thank you! this is why I was seeing the error message for a few seconds and then it was gone
Want results from more Discord servers?
Add your server