lukeraymonddowning / honey

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

Symfony\Component\HttpKernel\Exception\HttpException You shall not pass! #24

Closed ehsantalkhouncheh closed 3 years ago

ehsantalkhouncheh commented 3 years ago

I got this error after add honey middlware on my route :

Route::group(['middleware' => 'honey'], function () { Route::get('/directdebit', function () { return view('directdebit'); })->name('directdebit'); });

i use laravel 8 and livewire

lukeraymonddowning commented 3 years ago

Hurrah! That exception means that Honey is working. That is the default exception that gets thrown if a bot is detected. If you fill the form out too quickly or fill in the missing fields, it will fail.

ehsantalkhouncheh commented 3 years ago

The problem is i didn't fill form at all i got this error when i tried to visit the form

lukeraymonddowning commented 3 years ago

It looks like you've put the middleware on the GET route rather than the PUT or POST route that your form points to.

zepphub commented 2 years ago

I have the same problem but I think the middleware is in the right place

Route::post('/newsletter-subscription', [App\Http\Controllers\NewsletterSubscriptionController::class, 'store'] )->middleware(['honey', 'honey-recaptcha'])->name('newsletter-subscription');