34 lines
705 B
PHP
34 lines
705 B
PHP
<?php
|
|
|
|
namespace App\Services\Security;
|
|
|
|
use App\Services\Security\Captcha\TurnstileCaptchaProvider;
|
|
|
|
class TurnstileVerifier
|
|
{
|
|
public function __construct(
|
|
private readonly TurnstileCaptchaProvider $turnstileProvider,
|
|
) {
|
|
}
|
|
|
|
public function isEnabled(): bool
|
|
{
|
|
return $this->turnstileProvider->isEnabled();
|
|
}
|
|
|
|
public function siteKey(): string
|
|
{
|
|
return $this->turnstileProvider->siteKey();
|
|
}
|
|
|
|
public function scriptUrl(): string
|
|
{
|
|
return $this->turnstileProvider->scriptUrl();
|
|
}
|
|
|
|
public function verify(string $token, ?string $ip = null): bool
|
|
{
|
|
return $this->turnstileProvider->verify($token, $ip);
|
|
}
|
|
}
|