Skip to content

Commit cfc0a59

Browse files
committed
update
1 parent 06fa932 commit cfc0a59

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/App/src/Handler/PostCreateContactHandler.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ class PostCreateContactHandler implements RequestHandlerInterface
2424
TemplateRendererInterface::class,
2525
UrlHelper::class,
2626
ContactService::class,
27+
'config',
2728
)]
2829
public function __construct(
2930
protected TemplateRendererInterface $template,
3031
protected UrlHelper $urlHelper,
3132
protected ContactService $contactService,
33+
protected array $config,
3234
) {
3335
}
3436

@@ -42,7 +44,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
4244
$token = is_array($rawBody) && is_string($rawBody['cf-turnstile-response'] ?? null)
4345
? $rawBody['cf-turnstile-response']
4446
: '';
45-
$ip = $request->getAttribute('ip_address');
47+
$ip = $request->getAttribute($this->config['rka']['ip_address']['attribute_name'] ?? 'ip_address');
4648

4749
if (! $this->contactService->verifyTurnstile($token, $ip)) {
4850
$errors['captcha'] = "We couldn't verify you're human. Please try again.";

0 commit comments

Comments
 (0)