Skip to content

Add JWT Refresh Token with Rotation #39

@BEGINNERUSER-git

Description

@BEGINNERUSER-git

Feature Request
Implement JWT authentication with Refresh Token rotation.

Why
Currently, tokens expire without refresh, forcing users to log in again.
Adding refresh tokens will:
Improve user experience (silent refresh).
Increase security with token rotation.
Allow logout to invalidate refresh tokens.

Tasks
Update User model to store refresh tokens.
Add refresh token generation (with rotation).
Add refresh-token` endpoint.
Update login to return both access + refresh tokens.
Add logout endpoint to invalidate refresh tokens.

Security
Short-lived access tokens (15 min).
Long-lived refresh tokens (7 days).
Rotation to prevent replay attacks.
Refresh tokens stored in DB.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions