Function createToken

  • Parameters

    • payload: any
    • secret: string
    • expiresIn: string = '1h'

    Returns string

    Name

    createToken

    Version

    1.0.0

    Description

    Creates a JWT token from the given payload

    Summary

    function sign(payload: string | object | Buffer, secretOrPrivateKey: jwt.Secret, options?: jwt.SignOptions | undefined): string (+4 overloads) Synchronously sign the given payload into a JSON Web Token string payload - Payload to sign, could be an literal, buffer or string secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA. [options] - Options for the signature returns - The JSON Web Token string

Generated using TypeDoc