Class TOTPAbstract

Hierarchy (view full)

Constructors

Methods

  • Protected

    Returns a URI representation of the config

    Parameters

    • config: HOTPConfig
    • type: "totp" | "hotp"
    • Optional period: number

    Returns string

  • Generates a TOTP token using the supplied configuration values

    Parameters

    Returns [string, Secret]

  • Returns a QR code URL that will provide a scalable QR code of the config

    Parameters

    • config: Partial<TOTPConfig> = {}
    • width: number = 256
    • height: number = 256

    Returns string

  • Returns a URI representation of the config

    Parameters

    Returns string

  • Verifies a TOTP token using the supplied configuration values

    Parameters

    • otp: string | number
    • config: Partial<TOTPConfig> = {}

    Returns [boolean, null | number]