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:
@@ -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` در بدنهی همان درخواست میفرستد:
|
||||
|
||||
Reference in New Issue
Block a user