Skip to content

Commit

Permalink
Validation fails. Error code: timeout-or-duplicate greggilbert#140
Browse files Browse the repository at this point in the history
it could be nice to cache the first response,
so in the code if the same validation is called few times it will return the first validation result
  • Loading branch information
salexch authored Jul 1, 2018
1 parent c2ed383 commit 3fd78ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RecaptchaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function boot()
*/
public function addValidator()
{
$this->app->validator->extendImplicit('recaptcha', function ($attribute, $value, $parameters) {
$captcha = app('recaptcha.service');
$captcha = app('recaptcha.service');
$this->app->validator->extendImplicit('recaptcha', function ($attribute, $value, $parameters) use($captcha) {
$challenge = app('request')->input($captcha->getResponseKey());

return $captcha->check($challenge, $value);
Expand Down

0 comments on commit 3fd78ca

Please sign in to comment.