Revived API /api/v1/captcha.

Now a new captcha is created to check for a bot.
This commit is contained in:
2023-09-19 14:27:33 +06:00
parent 56cd409301
commit 27046e6674
22 changed files with 525 additions and 101 deletions

View File

@@ -23,9 +23,17 @@ final class Captcha extends JsonResource
public function toArray(Request $request): array
{
return [
'image_base64' => $this->resource->getImageBase64(),
'image_text_base64' => $this->resource->getImageTextBase64(),
'captcha_key' => $this->resource->getKey()
'image_head' => [
'base64' => $this->resource->getImageHead()->getImageBase64(),
'width' => $this->resource->getImageHead()->getWidth(),
'height' => $this->resource->getImageHead()->getHeight(),
],
'image_body' => [
'base64' => $this->resource->getImageBody()->getImageBase64(),
'width' => $this->resource->getImageBody()->getWidth(),
'height' => $this->resource->getImageBody()->getHeight(),
],
'captcha_key' => $this->resource->getKey()
];
}
}