verto-health / ngx-turnstile

Cloudflare Turnstile for Angular
https://ngx-turnstile.pages.dev/
MIT License
62 stars 13 forks source link

How to handle error, when captcha fails ? #26

Closed abhinavakhil closed 7 months ago

abhinavakhil commented 8 months ago

Hello, I'd like to request guidance on handling errors that occur when the captcha fails. Currently, we lack a solution for addressing this issue.

choyiny commented 8 months ago

What would you like to do when the captcha fails? I'm assuming you are referring to when the user does not pass the captcha.

matsonkepson commented 7 months ago

+1 for the error

i would like to implement the invisible captcha but i need to handle the errors when captcha is failing or has a problems with fetching key / contacting domain / etc

abhinavakhil commented 7 months ago

What would you like to do when the captcha fails? I'm assuming you are referring to when the user does not pass the captcha.

I am referring to both scenarios: 1) When we are using managed captcha & it fails and 2) When the user does not pass the captcha. I think in both these cases we should be able to handle errors. Personally, I want to reinitialize the captcha when it fails.

wilson-ascenda commented 7 months ago

Hey @abhinavakhil, there's a recently-added event handler for error codes released in ngx-turnstile@0.2.2, maybe that will be useful for you

To refresh the widget while handling the error codes, you can check this comment: https://github.com/verto-health/ngx-turnstile/issues/24#issuecomment-2016961475

choyiny commented 7 months ago

Resolved by #27