Class JsonWebTokenPropertyExpireAt

Property map for a JWT containing Expiration date.

Type Param

The type of the arguments needed to test the token.

Type Param

The type of the arguments needed to create the token.

Type Param

The type of the token's data.

Since

0.1.0

Hierarchy

  • JsonWebTokenProperty<Record<string, never>, {
        duration: number;
    } | {
        expire_at: number;
    }, {
        exp: number;
    }>
    • JsonWebTokenPropertyExpireAt

Constructors

Methods

Constructors

Methods

  • Checks if the token is valid.

    Parameters

    • jwt: {
          exp: number;
      }

      The JWT to check.

      • exp: number

    Returns boolean

    true if the token is valid, false otherwise.

    Since

    0.1.0

  • Transforms the JWT by adding an expiration date.

    Parameters

    • jwt: JsonWebTokenData

      The JWT to transform.

    • args: {
          duration: number;
      } | {
          expire_at: number;
      }

      The arguments needed to transform the JWT.

    Returns {
        exp: number;
    }

    The transformed JWT.

    • exp: number

    Since

    0.1.0

Generated using TypeDoc