Compare commits

...

2 Commits

Author SHA1 Message Date
032185b52c
Add instructions to README.md. 2023-12-03 01:06:09 +06:00
d9e9564ea8
Fix typo in 'user_agent' key assignment.
A typo in the key assignment for 'user_agent' in the CaptchaService has been fixed. The key was previously incorrectly typed as 'user_ageng'. This issue was causing problems with HTTP posts where user agent data was not being properly passed due to the misspelt key.
2023-12-03 00:58:47 +06:00
2 changed files with 32 additions and 1 deletions

View File

@ -1,2 +1,33 @@
# captcha-rule-for-laravel
Laravel 10. Rule Validation для сервиса https://git.kor-elf.net/kor-elf/service-captcha.
Параметры в .env.
# CAPTCHA_API_DOMAIN
Указываем адрес к сервису для проверки от робота.
Примеры: http://captcha.localhost:9008, https://captcha.localhost, http://captcha.localhost
# CAPTCHA_PRIVATE_TOKEN
Указываем приватный токен, для проверки со стороны сервера.
# CAPTCHA_CURL_TIMEOUT
Curl timeout в секундах.
По умолчанию: 10
# CAPTCHA_ENABLE_BLADE_CAPTCHA
Включает Blade::directive "captcha" (@captcha).
По умолчанию: true
# CAPTCHA_PUBLIC_TOKEN
Указываем публичный токен, который мы получаем от сервиса для проверки от робота.
# CAPTCHA_STATIC_PATH
Указываем путь к статике.
Примеры: /captcha, https://captcha.localhost/captcha
По умолчанию: env('CAPTCHA_API_DOMAIN') . '/captcha'

View File

@ -17,7 +17,7 @@ final readonly class CaptchaService
try {
$post = [];
if (!is_null($userAgent)) {
$post['user_ageng'] = $userAgent;
$post['user_agent'] = $userAgent;
}
$response = Http::withHeaders([