g-recaptcha-response is required - but it's not available on the server side; it's empty/null
renepardon opened this issue · 2 comments
renepardon commented
Hello,
I've integrated this package but encounter an issue when using it on localhost:8080.
The g-recaptcha-response get's filled and sent to the server but it never arrives like all the other parameters. Did you ever had such a behaviour?
I'm using laravel 5.7.
Parameter is sent to the server:
But doesn't appear within POST parameters: (dumped with dd($request->except('password'));
)
I've created a LoginRequest class which does the validation and fails because it tells me that g-recaptcha-response is required:
public function rules()
{
$rules = [
config('access.users.username') => 'required|string',
'password' => 'required|string',
];
if (setting('login_captcha_enabled')) {
switch (setting('login_captcha')) {
case 'recaptcha':
$rules['g-recaptcha-response'] = 'required|recaptcha';
break;
case 'captcha':
// no break - captcha is the default if none is defined
default:
$rules['captcha'] = 'required|captcha';
}
}
return $rules;
}
renepardon commented
Just as a side note: the password is just a localhost demo account password ;)
tayyabhussainit commented
@renepardon how did you fix it ?