@creator.co/wapi - v1.8.1
    Preparing search index...

    Represents a JSON Web Token (JWT) utility class.

    Index

    Constructors

    • Constructs a new instance of the class.

      Parameters

      • tokenSecret: string

        The secret used to sign the tokens.

      • OptionaldefaultExpiration: string

        The default expiration time for the tokens.

      Returns default

      None

    Methods

    • Creates a JSON Web Token (JWT) using the provided data and options.

      Parameters

      • data: object

        The data to be included in the token payload.

      • Optionalexpiration: string

        The expiration time for the token. If not provided, the default expiration time will be used.

      • OptionaloverrideToken: string

        An optional token secret to override the default token secret.

      • Optionalopts: any

        Additional options to be passed to the jwt.sign() function.

      Returns string

      • The generated JWT.
    • Validates a JSON Web Token (JWT) and returns the validation response.

      Parameters

      • token: string

        The JWT to validate.

      Returns JWTValidationResponse

      • The validation response object.