Setu-TS
    Preparing search index...

    Interface RefreshTokenStore

    Store interface for refresh tokens.

    Implementations must track each jti so the service can rotate (revoke the presented token, issue a new pair) and revoke (logout). All methods are async so remote backends (e.g. a future Redis store) can implement the interface without a breaking change.

    interface RefreshTokenStore {
        get(jti: string): Promise<RefreshTokenRecord | null>;
        revoke(jti: string): Promise<void>;
        revokeFamily(jti: string): Promise<readonly RefreshTokenRecord[]>;
        rotate(
            jti: string,
            successor: RefreshTokenRecord,
        ): Promise<IRefreshTokenRotation>;
        save(record: RefreshTokenRecord): Promise<void>;
    }

    Implemented by

    Index
    • Revoke every refresh token in the requested token's family.

      Returns the affected records so the caller can also revoke their paired access credentials through its separately configured store. Remote implementations must serialize this operation with rotate() for the same family: durably mark the family revoked and revoke current members in one operation, while rotate() atomically rejects a marked family. A rotation ordered before this operation must have its successor included; one ordered after it must not persist a successor.

      Parameters

      • jti: string

      Returns Promise<readonly RefreshTokenRecord[]>