mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 00:01:21 +00:00
Fix request validation in login and register pages
This commit is contained in:
@@ -129,8 +129,6 @@ class RegisterController extends Controller
|
||||
'password' => ['required', 'confirmed', Password::min(8)->letters()->mixedCase()->numbers()->symbols()->uncompromised()],
|
||||
]);
|
||||
|
||||
if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
|
||||
}
|
||||
|
||||
if ($validator->fails()) {
|
||||
$error = implode('', Arr::collapse($validator->errors()->toArray()));
|
||||
|
||||
@@ -18,6 +18,8 @@ class LoginLoginRequest extends FormRequest
|
||||
'captcha',
|
||||
],
|
||||
];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,16 @@ class RegisterRegisterRequest extends FormRequest
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'g-recaptcha-response' => [
|
||||
'required',
|
||||
'captcha',
|
||||
],
|
||||
];
|
||||
if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
|
||||
return [
|
||||
'g-recaptcha-response' => [
|
||||
'required',
|
||||
'captcha',
|
||||
],
|
||||
];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user