gog / recaptcha-firewall
此包已废弃且不再维护。未建议替代包。
1.0.2
2015-11-02 12:25 UTC
Requires
- google/recaptcha: ^1.1
- symfony/config: ~2.3
- symfony/dependency-injection: ~2.3
- symfony/event-dispatcher: ~2.3
- symfony/http-kernel: ~2.3
- symfony/yaml: ~2.3
This package is not auto-updated.
Last update: 2018-05-15 00:51:09 UTC
README
这是一个简单的组件,通过添加ReCaptcha验证来保护路由。
安装
使用composer安装
$ composer require gog/recaptcha-firewall
然后在AppKernel.php
文件中注册这个bundle
public function registerBundles() { $bundles = array( // ... new GOG\Security\RecaptchaFirewall\Bundle\GOGSecurityRecaptchaFirewallBundle(), // ... ); return $bundles; }
配置
只需将以下行添加到您的config.yml
文件中即可配置bundle。
gog_security_recaptcha_firewall: secret: your_secret site_key: your_site_key routes: - route_name1 - route_name2
它是如何工作的?
配置树中添加的每个路由都会检查有效的g-recaptcha-response
令牌。如果验证失败,您将在检查的路由上收到一个403 JSON响应。