lukeraymonddowning / honey

A spam prevention package for Laravel, providing honeypot techniques, ip blocking and beautifully simple Recaptcha integration. Stop spam. Use Honey.
MIT License
409 stars 23 forks source link

timeouts not being handled #27

Open rbmcgowan opened 3 years ago

rbmcgowan commented 3 years ago

Hi, I am seeing the following errors appear in the logs occasionally. The application is hosted in a data centre so it's unlikely to be related to an internet outage, especially since there have been a few of them over the past month. Regardless, it would be good if the code monitored for this and moved on rather than failing.

ERROR: The following errors were thrown when trying to resolve the recaptcha token: timeout-or-duplicate {"exception":"[object] (Lukeraymonddowning\Honey\Exceptions\RecaptchaFailedException(code: 0): The following errors were thrown when trying to resolve the recaptcha token: timeout-or-duplicate at /var/www/html/laravel/vendor/lukeraymonddowning/honey/src/Recaptcha.php:37)

lukeraymonddowning commented 3 years ago

Hi there. Are you using Livewire?

rbmcgowan commented 3 years ago

Hi Luke, no there is no Livewire.

usernotnull commented 3 years ago

I'm using Livewire and I have previously reported this issue, and a PR was submitted and fixed the issue.

I am currently facing a similar issue again, but due to the complexity of the layout changes, I won't bother reproducing the steps.

Suffice to say, when the x hits the fan, manually call '$this->requestRecaptchaTokenRefresh();' which was added by the PR. Resolved my issue in a complex setup. See if you can catch the error and call that method.