JWT Session Storage

    The JWT session storage converts sessions to and from.

    Examples

    jwtStorage(options): Storage

    Creates a Storage that can be used in the sessions middleware.

    Arguments

    • options: Object

    An object with the following properties:

    • algorithm: string (Default: "HS512")

    The algorithm to use for signing the token.

    Supported values:

    1. - <code>&#34;HS512&#34;</code> (HMAC-SHA512)
    2. - <code>&#34;none&#34;</code> (no signature)

    This field is forbidden when using the “none” algorithm but required otherwise.

    • ttl: number (Default: 3600)

    The maximum lifetime of the token in seconds. You may want to keep thisshort as a new token is generated on every request allowing clients torefresh tokens automatically.

    • verify: (Default: true)

    If set to false the signature will not be verified but still generated(unless using the “none” algorithm).

    • maxExp: number (Default: Infinity)

    Largest value that will be accepted in an incoming JWT exp (expiration) field.