Skip to main content
Version: 1.2.0

Reject expired API tokens

Version: 1.2.0 Date: 2026-10-18

Goal: Neo must not authenticate an API token whose exp is already in the past.

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 apitokens row is not deleted.

Features:

  • Past exp → 401, user not authenticated
  • exp null or missing → token still accepted
  • No delete of the apitokens row

Files Modified:

  • src/core/auth/auth.service.ts - Expiry check on API token lookup
  • src/core/auth/auth.service.spec.ts - Past, null, and missing exp

Release fragment: fix-reject-expired-api-tokens