Skip to content

Commit

Permalink
Merge pull request #102 from simondubois/master
Browse files Browse the repository at this point in the history
Allow private & public key config value to be a Closure
  • Loading branch information
greggilbert committed Feb 17, 2016
2 parents b84d3b4 + 99ba137 commit fb835b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function render($options = [ ])
$mergedOptions = array_merge($this->config['options'], $options);

$data = [
'public_key' => $this->config['public_key'],
'public_key' => value($this->config['public_key']),
'options' => $mergedOptions,
'dataParams' => $this->extractDataParams($mergedOptions),
];
Expand Down
4 changes: 2 additions & 2 deletions src/Service/CheckRecaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CheckRecaptcha implements RecaptchaInterface
public function check($challenge, $response)
{
$parameters = http_build_query([
'privatekey' => app('config')->get('recaptcha.private_key'),
'privatekey' => value(app('config')->get('recaptcha.private_key')),
'remoteip' => app('request')->getClientIp(),
'challenge' => $challenge,
'response' => $response,
Expand Down Expand Up @@ -68,4 +68,4 @@ public function getResponseKey()
{
return 'recaptcha_challenge_field';
}
}
}
2 changes: 1 addition & 1 deletion src/Service/CheckRecaptchaV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CheckRecaptchaV2 implements RecaptchaInterface
public function check($challenge, $response)
{
$parameters = http_build_query([
'secret' => app('config')->get('recaptcha.private_key'),
'secret' => value(app('config')->get('recaptcha.private_key')),
'remoteip' => app('request')->getClientIp(),
'response' => $response,
]);
Expand Down

0 comments on commit fb835b2

Please sign in to comment.