fix-reject-expired-api-tokens
🐛 Bug Fixes
Reject expired API tokens
Goal: Neo must not authenticate an API token whose exp is already in the past. Legacy getApiToken already treats that date as invalid.
Solution: AuthService.getApiTokenUser throws before the user is loaded when apitokens.exp is a past date. The authorization middleware turns that into 401. exp null or absent stays valid. The document is not deleted; the legacy API and neo share the collection, and legacy already deletes on its own path.
Features:
- Past
exp→ 401, user not authenticated expnull or missing → token still accepted- No delete of the
apitokensrow
Files Modified:
src/core/auth/auth.service.ts- Expiry check on API token lookupsrc/core/auth/auth.service.spec.ts- Past, null, and missingexp