Forbid users to select dates after 2038 on 32-bit systems to prevent errors caused by Year2038 bug

See discussion #548 and #549
This commit is contained in:
Jan Böhmer 2024-03-09 00:11:00 +01:00
parent 18c697f472
commit 206bcebdb7
8 changed files with 167 additions and 36 deletions

View file

@ -32,6 +32,7 @@ use App\Entity\Base\TimestampTrait;
use App\Entity\Contracts\TimeStampableInterface;
use App\Repository\UserSystem\ApiTokenRepository;
use App\State\CurrentApiTokenProvider;
use App\Validator\Constraints\Year2038BugWorkaround;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
@ -76,6 +77,7 @@ class ApiToken implements TimeStampableInterface
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
#[Groups('token:read')]
#[Year2038BugWorkaround]
private ?\DateTimeInterface $valid_until;
#[ORM\Column(length: 68, unique: true)]