Refresh token rotation
Issuing a new refresh token every time one is used and invalidating the old one. Consuming the old token with an atomic GETDEL means two requests racing with the same token cannot both succeed, and a replayed token is rejected.
Minimal example
GETDEL refresh:{old} -> user_id or nil
SET refresh:{new} {user_id} EX 2592000Learn this concept
Lesson 3.2 · JWT and refresh token rotationUsed in exercises
Exercise 3.3 · POST /v1/auth/*: signup, login and refresh Exercise 3.22 · POST /v1/auth/refresh: detect token reusePrerequisite conceptsRefresh token
RelatedRefresh token