$totp = $secret->getTotp();
$minCounter = 0;
- if (!$totp->validateTotpCode($field->getValue(), $minCounter, new \DateTime())) {
+ if (!$totp->validateTotpCode($field->getValue(), $minCounter, new \DateTimeImmutable())) {
$field->value('');
$field->addValidationError(new FormFieldValidationError(
'invalidCode',
$totp = new Totp($selectedDevice['secret']);
$minCounter = $selectedDevice['minCounter'];
- if (!$totp->validateTotpCode($field->getValue(), $minCounter, new \DateTime())) {
+ if (!$totp->validateTotpCode($field->getValue(), $minCounter, new \DateTimeImmutable())) {
$field->value('');
$field->addValidationError(new FormFieldValidationError(
'invalidCode',