Refresh token rotation
A refresh token gets a user a new access token without logging in again. With rotation, each refresh token works exactly once: using it returns a fresh pair and invalidates the old one.
Your login now issues long-lived refresh tokens. Rotation means a leaked token is only useful until its owner refreshes, and reuse of an old one revokes the whole chain.
# auth/tokens.py def rotate_refresh_token(old_token): family = revoke(old_token) # reuse → revoke family return issue_pair(family=family)