Merge pull request #384 from specialpointcentral/php8

[RFC] Refine captcha configuration and drivers
This commit is contained in:
xiaomlove
2025-10-12 04:18:55 +07:00
committed by GitHub
16 changed files with 734 additions and 100 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
return [
'default' => nexus_env('CAPTCHA_DRIVER', 'image'),
'drivers' => [
'image' => [
'class' => \App\Services\Captcha\Drivers\ImageCaptchaDriver::class,
],
'cloudflare_turnstile' => [
'class' => \App\Services\Captcha\Drivers\TurnstileCaptchaDriver::class,
'site_key' => nexus_env('TURNSTILE_SITE_KEY'),
'secret_key' => nexus_env('TURNSTILE_SECRET_KEY'),
'theme' => nexus_env('TURNSTILE_THEME', 'auto'),
'size' => nexus_env('TURNSTILE_SIZE', 'auto'),
],
'google_recaptcha_v2' => [
'class' => \App\Services\Captcha\Drivers\RecaptchaV2CaptchaDriver::class,
'site_key' => nexus_env('RECAPTCHA_SITE_KEY'),
'secret_key' => nexus_env('RECAPTCHA_SECRET_KEY'),
'theme' => nexus_env('RECAPTCHA_THEME', 'light'),
'size' => nexus_env('RECAPTCHA_SIZE', 'normal'),
],
],
];