mirror of
https://github.com/better-auth/better-auth.git
synced 2026-08-01 10:50:40 -05:00
* fix(api-key): API Keys with expiresAt not null
The `deleteAllExpiredApiKeys` function in the apiKey plugin deletes API keys where `expiresAt` is `null`, despite these keys being intended as non-expiring.
This occurs because the deleteMany query does not explicitly exclude null values in the expiresAt condition.
This leads to unexpected key deletions, affecting keys like
`{ "_id": "6876ba254c23e91c05c9e95b", "expiresAt": null }`.
* Update index.ts
* chore: lint
---------
Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>