Skip to content

redisRefreshTokenStore

redisRefreshTokenStore(client, options?): RefreshTokenStore

Defined in: redis-refresh-token-store.ts:25

Redis-backed RefreshTokenStore for multi-instance deployments.

Layout: each jti is a string key holding its sub with a TTL matching the token’s exp (SET … EX), and each subject has a set of its outstanding jtis so revokeAll can find them. consume uses GETDEL, so concurrent consumers of the same token — the rotation-theft race — resolve atomically: exactly one caller sees true.

The per-subject set is re-armed to the newest token’s TTL on every add. Under a fixed refreshExpiresIn the newest token always expires last, so the set outlives all its members; stale members left by key expiry are harmless (consume and revokeAll treat a missing jti key as gone).

RedisClientLike

RedisRefreshTokenStoreOptions = {}

RefreshTokenStore