lukeraymonddowning / honey

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

The server returned a "422 Unprocessable Content". #55

Closed nuz closed 2 years ago

nuz commented 2 years ago

Hi,

When I'm trying to post a form, I'm getting:

Oops! An Error Occurred
The server returned a "422 Unprocessable Content".

Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

web.php

Route::controller(ContactsController::class)
    ->as('contacts.')
    ->group(function () {
        Route::post('contact-us', 'store')
            ->middleware(['honey', 'honey-recaptcha'])
            ->name('store');
    });

in a form I'm using <x-honey/> and <x-honey-recaptcha action="contacts"/> directives.

No errors in laravel.log.

What problem could it be?

EmmanuelAyTuz commented 2 years ago

You are a spammer :), hahah reading the description this code is... "Customising what happens on failure By default, Honey will abort with a 422 status code when it detects spam through its middleware stack. Of course, you may wish to do something completely different. No problem! Just tell Honey what it should do instead in the boot method of your Service Provider:"

but the question why? and how?, I don´t know if you env is prod, local or custom but check this feature "Spammer IP Tracking When enabled, Honey will add a spammers migration to your database. Any time somebody fails the spam check, their IP address is added to the spammers table. If you don't want Honey to track this, simply disable the feature."

Review the config/config.php file