import type { JWTPayload } from "jose";

export interface RefreshTokenPayload extends JWTPayload {
  userId: string;
  /**
   * Refresh token family identifier (stable across rotations).
   * Present on newly issued tokens; legacy tokens used `tokenId` for this value.
   */
  familyId?: string | undefined;
  /**
   * Refresh token identifier (unique per token). Used for replay/reuse detection.
   * For legacy tokens, this was equal to the family id.
   */
  tokenId: string;
  deviceId?: string | undefined;
  userAgent?: string | undefined;
  type: "refresh";
}

export interface DeviceInfo {
  deviceId?: string | undefined;
  userAgent?: string | undefined;
}
