Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Totp

Class responsible for manipulations with TOTP tokens.

Hierarchy

  • Totp

Constructors

Methods

Constructors

constructor

  • new Totp(opts: Options): Totp
  • Parameters

    • opts: Options

    Returns Totp

Methods

check

  • check(received: string, stored?: string, logger?: object): boolean
  • Checks the provided TOTP against signature and stored TOTP.

    Parameters

    • received: string

      Received plain TOTP. His signature will be verified.

    • Optional stored: string
    • Optional logger: object
      • error: function
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

    Returns boolean

    Whether TOTP is valid.

generate

  • generate(): string
  • Generates TOTP.

    Returns string

    Generated TOTP.