Skip to content

Commit

Permalink
Allow public_key and private_key config values to be Closure
Browse files Browse the repository at this point in the history
  • Loading branch information
simondubois committed Jan 30, 2016
1 parent b84d3b4 commit 99ba137
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 99ba137

Please sign in to comment.