Skip to content

[Backend] — Auth Refresh Token Rotation and Reuse Detection #1637

Description

@Olowodarey

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions