Fixed error caused by immutable datetime passed to mutable datetime doctrine type

This commit is contained in:
Jan Böhmer 2024-06-10 20:47:06 +02:00
parent 4d927c5870
commit 777f6ba738
4 changed files with 11 additions and 11 deletions

View file

@ -75,7 +75,7 @@ class ApiTokenAuthenticator implements AuthenticatorInterface
$old_time = $token->getLastTimeUsed();
//Set the last used date of the token
$token->setLastTimeUsed(new \DateTimeImmutable());
$token->setLastTimeUsed(new \DateTime());
//Only flush the token if the last used date change is more than 10 minutes
//For performance reasons we don't want to flush the token every time it is used, but only if it is used more than 10 minutes after the last time it was used
//If a flush is later in the code we don't want to flush the token again