File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -217,16 +217,18 @@ public function removeExpired(): void
217217 {
218218 $ accessTokenTableName = $ this ->getTableName ();
219219 $ refreshTokenTableName = $ this ->database ->applyPrefix (RefreshTokenRepository::TABLE_NAME );
220+ $ now = $ this ->helpers ->dateTime ()->getUtc ()->format (DateFormatsEnum::DB_DATETIME ->value );
220221
221222 // Delete expired access tokens, but only if the corresponding refresh token is also expired.
222223 $ this ->database ->write (
223224 "DELETE FROM $ accessTokenTableName WHERE expires_at < :now AND
224225 NOT EXISTS (
225226 SELECT 1 FROM {$ refreshTokenTableName }
226- WHERE $ accessTokenTableName.id = $ refreshTokenTableName.access_token_id AND expires_at > :now
227+ WHERE $ accessTokenTableName.id = $ refreshTokenTableName.access_token_id AND expires_at > :now2
227228 ) " ,
228229 [
229- 'now ' => $ this ->helpers ->dateTime ()->getUtc ()->format (DateFormatsEnum::DB_DATETIME ->value ),
230+ 'now ' => $ now ,
231+ 'now2 ' => $ now ,
230232 ],
231233 );
232234 }
You can’t perform that action at this time.
0 commit comments