feat(captcha): add ALTCHA configuration endpoint and integrate into HomeController

- Introduced a new endpoint `/api/v1/altcha/config` in CaptchaController to return the status of the ALTCHA captcha.
- Updated HomeController to inject AltchaService and pass the captcha status to the home page template.
- Modified the home.html.twig template to conditionally render the ALTCHA widget based on the captcha status.
- Updated manifest.json and cache files to reflect changes in the codebase.
This commit is contained in:
hamed
2026-07-10 11:18:40 +03:30
parent 6f2e0ec2f1
commit c3c520801d
15 changed files with 727 additions and 625 deletions
+11
View File
@@ -28,6 +28,17 @@
---
## GET `/api/v1/altcha/config`
وضعیت فعال بودن کپچا. **عمومی**. کلاینت‌ها قبل از رندر widget این را می‌خوانند؛ اگر `enabled=false` باشد، هیچ widgetی نشان داده نمی‌شود و فرم‌ها بدون فیلد `altcha` ارسال می‌شوند (بک‌اند هم no-op است).
### Response `200`
```json
{ "enabled": false }
```
---
## اعمال کپچا روی endpointهای محافظت‌شده
کلاینت مقدار حل‌شده‌ی widget (base64) را با کلید `altcha` در بدنه‌ی همان درخواست می‌فرستد: