Add recaptcha to login/register form
This commit is contained in:
parent
9fbc5d0902
commit
92939ed867
9 changed files with 293 additions and 171 deletions
|
@ -52,12 +52,19 @@ class RegisterController extends Controller
|
|||
{
|
||||
$this->validateUsername($data['username']);
|
||||
|
||||
return Validator::make($data, [
|
||||
|
||||
$rules = [
|
||||
'name' => 'required|string|max:255',
|
||||
'username' => 'required|alpha_dash|min:2|max:15|unique:users',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'password' => 'required|string|min:6|confirmed',
|
||||
]);
|
||||
];
|
||||
|
||||
if(config('pixelfed.recaptcha')) {
|
||||
$rules['g-recaptcha-response'] = 'required|recaptcha';
|
||||
}
|
||||
|
||||
return Validator::make($data, $rules);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue