Skip to main content
Version: 1.4.0

API tokens

Overview​

Bearer API tokens in apitokens authenticate neo routes. A token with exp in the past is rejected.

How it works​

AuthService.getApiTokenUser loads the token, then throws before the user is loaded when exp is a past date. The authorization middleware returns 401. exp null or absent stays valid. Neo does not delete the row; the legacy API deletes on its own path.

Key files​

  • src/core/auth/auth.service.ts — expiry check on API token lookup
  • src/core/auth/auth.service.spec.ts — past, null, and missing exp

Technical decisions​

  • Shared apitokens collection with the legacy API. Neo only refuses the request.

Known issues​

  • A token with no exp never expires on this path.

Next steps​

  • Align delete-on-expiry with the legacy API if both services must drop the row