Revived API /api/v1/captcha.
Now a new captcha is created to check for a bot.
This commit is contained in:
27
app/Dto/HttpUserData.php
Normal file
27
app/Dto/HttpUserData.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Dto;
|
||||
|
||||
final readonly class HttpUserData
|
||||
{
|
||||
public function __construct(
|
||||
private ?string $clientIp = null,
|
||||
private ?string $userAgent = null,
|
||||
private ?string $referer = null
|
||||
) { }
|
||||
|
||||
public function getClientIp(): ?string
|
||||
{
|
||||
return $this->clientIp;
|
||||
}
|
||||
|
||||
public function getUserAgent(): ?string
|
||||
{
|
||||
return $this->userAgent;
|
||||
}
|
||||
|
||||
public function getReferer(): ?string
|
||||
{
|
||||
return $this->referer;
|
||||
}
|
||||
}
|
25
app/Dto/Request/Api/V1/Captcha/CaptchaPublicToken.php
Normal file
25
app/Dto/Request/Api/V1/Captcha/CaptchaPublicToken.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Dto\Request\Api\V1\Captcha;
|
||||
|
||||
use App\Dto\HttpUserData;
|
||||
use App\Dto\Request\Dto;
|
||||
use App\Models\CaptchaToken;
|
||||
|
||||
final readonly class CaptchaPublicToken extends Dto
|
||||
{
|
||||
public function __construct(
|
||||
private CaptchaToken $captchaToken,
|
||||
private HttpUserData $httpUserData
|
||||
) { }
|
||||
|
||||
public function getCaptchaToken(): CaptchaToken
|
||||
{
|
||||
return $this->captchaToken;
|
||||
}
|
||||
|
||||
public function getHttpUserData(): HttpUserData
|
||||
{
|
||||
return $this->httpUserData;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user