Authentication API
Central authentication service backed by the existing users table.
Production clients must use HTTPS. Passwords, OTPs and tokens must never be logged.
Endpoints
Login example
curl -X POST https://your-domain.example/api/auth/v1/login \
-H 'Content-Type: application/json' \
-d '{"username":"somchai","password":"...","device_name":"Finance Portal"}'Authenticated request
curl https://your-domain.example/api/auth/v1/me \ -H 'Authorization: Bearer ACCESS_TOKEN'
Token lifecycle
Access tokens are short-lived RS256 JWTs. Refresh tokens are opaque, stored only as hashes, rotated on every use, and their complete family is revoked when reuse is detected. Backend systems requiring immediate revocation checks should use /introspect with their own client credentials.