Skip to content

RefreshTokenStore

Defined in: types.ts:29

Tracks issued refresh tokens by jti so rotation and revocation work. Methods are sync-or-async so a Redis-backed store can be injected without an interface change.

add(jti, sub, expiresAt): void | Promise<void>

Defined in: types.ts:31

Record an issued refresh token. expiresAt is the JWT exp in epoch seconds.

string

string

number

void | Promise<void>


consume(jti): boolean | Promise<boolean>

Defined in: types.ts:37

Atomically remove jti, returning whether it was present. A false return for a token whose JWT still verifies means the token was already used — treat it as theft and revoke the family.

string

boolean | Promise<boolean>


revokeAll(sub): void | Promise<void>

Defined in: types.ts:39

Revoke every outstanding refresh token for a subject.

string

void | Promise<void>