Problem
auth refresh tokens may be long-lived without rotation, so a leaked token stays valid and reuse goes undetected.
Requirements
- Rotate refresh tokens on use; invalidate the prior token.
- Detect reuse of a rotated token and revoke the session family.
- Tests: rotation issues a new token; reuse triggers family revocation.
Acceptance Criteria
- Refresh tokens rotate and reuse is detected and blocked. Covered by tests.
Files
backend/src/auth/auth.service.ts
backend/src/migrations/1777000000000-CreateRefreshTokens.ts
backend/src/auth/auth.module.ts
Problem
authrefresh tokens may be long-lived without rotation, so a leaked token stays valid and reuse goes undetected.Requirements
Acceptance Criteria
Files
backend/src/auth/auth.service.tsbackend/src/migrations/1777000000000-CreateRefreshTokens.tsbackend/src/auth/auth.module.ts