Captcha

Integrates Googles reCAPTCHA into October.

Back to Captcha Support

Sergey
Sergey

exists('g-recaptcha-response'))
{
$recaptcha = new ReCaptcha( Settings::get('secret_key') );

/**
* Verify the reponse, pass user's IP address
*/
$response = $recaptcha->verify(
$request->input('g-recaptcha-response'),
$request->ip()
);

/**
* Fail, if the response isn't OK
*/
if (! $response->isSuccess()) {
if ($request->ajax()) {
throw new ApplicationException('Капча не валидна, убедитесь, что галочка стоит.');//throw new AjaxException( $response->getErrorCodes() );
} else {
foreach ($response->getErrorCodes() as $code) {
Flash::error( $code );
}

return redirect()->back()->withInput(); 
} 
}
}

/**
* Handle request
*/
return $next($request);
}

}

This is a fix for captcha exception

alxy
alxy

What exactly does that fix?

Sergey
Sergey

before http://joxi.ru/5mddWDDuvoEj9m after http://joxi.ru/Vm66bNNsxPeOpm

captcha output exception error. Now, application error with your own message

1-3 of 3