-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reCAPTCHA to laravel Auth #54
Comments
To Register, go to :app/Http/Controllers/Auth/RegisterController.php it has the following action: /**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6|confirmed',
]);
} you may add : /**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6|confirmed',
'g-recaptcha-response' => 'required|captcha'
]);
} the view of register is located at: add the snippet generator... loginthe LoginController uses the following trait: <?php
use Illuminate\Foundation\Auth\AuthenticatesUsers; and it has a function: /**
* Validate the user login request.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function validateLogin(Request $request)
{
$this->validate($request, [
$this->username() => 'required', 'password' => 'required',
]);
} Override this function inside the Controller and add the same validation of register, i hope it helps you 😺 |
I solved it by removing all files under laravel-auth/storage/framework/sessions |
Hello,
How can I add reCAPTCHA to laravel Auth?(Default Auth)
The text was updated successfully, but these errors were encountered: