diff --git a/config/turnstile.php b/config/turnstile.php index 7e05ae5..74c9d6a 100644 --- a/config/turnstile.php +++ b/config/turnstile.php @@ -25,7 +25,6 @@ | when testing your application. Disabling ensure your tests runs | smoothly. remember to enable once you are done testing. | - | */ 'enabled' => env(key: 'TURNSTILE_ENABLED', default: true), @@ -38,7 +37,20 @@ | application. Failure to include the field in the request will cause | a runtime exception. This is precautionary measure. | - | */ 'field' => env(key: 'TURNSTILE_FIELD', default: 'cf-turnstile-response'), + + /* + |-------------------------------------------------------------------------- + | Turnstile Site Verify Url + |-------------------------------------------------------------------------- + | + | This is the cloudflare endpoint that is used to verify the turnstile + | token. You must must call the siteverify endpoint to validate the + | Turnstile widget response + | + | Learn more: https://developers.cloudflare.com/turnstile/get-started/server-side-validation/ + | + */ + 'url' => env(key: 'TURNSTILE_URL', default: 'https://challenges.cloudflare.com/turnstile/v0/siteverify'), ]; diff --git a/src/Turnstile.php b/src/Turnstile.php index cdf7ba8..e34a3f6 100755 --- a/src/Turnstile.php +++ b/src/Turnstile.php @@ -13,7 +13,7 @@ class Turnstile public function __construct() { - $this->url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify'; + $this->url = config(key: 'turnstile.url'); $this->secretKey = config(key: 'turnstile.secretkey');