prometee / sylius-google-recaptcha-v3-plugin
插件,为Sylius的前端表单类型添加Google reCAPTCHA v3字段
v1.0.1
2023-11-18 17:52 UTC
Requires
- karser/karser-recaptcha3-bundle: ^0.1.3
- sylius/sylius: ^1.4
Requires (Dev)
- ext-json: *
- behat/behat: ^3.7
- behat/mink: ^1.9
- dmore/behat-chrome-extension: ^1.4
- dmore/chrome-mink-driver: ^2.8
- friends-of-behat/mink: ^1.9
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.2
- phpstan/phpstan-doctrine: ^1
- phpstan/phpstan-strict-rules: ^1
- phpstan/phpstan-webmozart-assert: ^1
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^5.4|^6.0
- symfony/debug-bundle: ^5.4|^6.0
- symfony/dotenv: ^5.4|^6.0
- symfony/http-client: ^5.4|^6.0
- symfony/intl: ^5.4|^6.0
- symfony/runtime: ^5.4|^6.0
- symfony/web-profiler-bundle: ^5.4|^6.0
- symfony/webpack-encore-bundle: ^1.16
- vimeo/psalm: ^4|^5
This package is auto-updated.
Last update: 2024-09-18 19:38:07 UTC
README
Sylius 插件,添加Google Recaptcha V3集成
此插件将Google Recaptcha V3添加到以下表单
- 联系表单
- 注册表单
但提供了一个抽象类,可以将验证码字段添加到任何其他 Form\Extension
安装
composer require prometee/sylius-google-recaptcha-v3-plugin
配置
启用此插件
<?php # config/bundles.php return [ // ... Prometee\SyliusGoogleRecaptchaV3Plugin\PrometeeSyliusGoogleRecaptchaV3Plugin::class => ['all' => true], // ... ];
此插件使用 karser/karser-recaptcha3-bundle
来处理Google Recaptcha V3的验证,因此需要进行一些配置。添加或修改 karser/karser-recaptcha3-bundle
的配置
# config/packages/karser_recaptcha3.yaml karser_recaptcha3: host: 'www.recaptcha.net' # in case 'www.google.com' is not accessible (from China for example) site_key: '%env(GOOGLE_RECAPTCHA_SITE_KEY)%' secret_key: '%env(GOOGLE_RECAPTCHA_SECRET)%' score_threshold: 0.5
最后,将您的站点密钥和密钥添加到您的 .env.local
文件
###> google/recaptcha ### GOOGLE_RECAPTCHA_SITE_KEY=my_site_key GOOGLE_RECAPTCHA_SECRET=my_secret ###< google/recaptcha ###