Interface CreateJwtOptions<Payload, Transformed>

interface CreateJwtOptions<Payload, Transformed> {
    additionalValidations?: ValidationFunction<Payload, Transformed>[];
    algorithms?: Algorithm[];
    allowedAud?: string | RegExp | (string | RegExp)[];
    allowedIss?: string | RegExp | (string | RegExp)[];
    allowedJti?: string | RegExp | (string | RegExp)[];
    allowedNonce?: string | RegExp | (string | RegExp)[];
    allowedSub?: string | RegExp | (string | RegExp)[];
    cache?: number | boolean;
    cacheTTL?: number;
    checkTyp?: string;
    clockTimestamp?: number;
    clockTolerance?: number;
    complete?: boolean;
    discoveryEndpoint?: string;
    errorCacheTTL?: number | ((tokenError) => number);
    ignoreExpiration?: boolean;
    ignoreNotBefore?: boolean;
    issuer?: string;
    key?: string;
    maxAge?: number;
    requiredClaims?: string[];
    schema: Payload;
    transformer?: JwtPayloadTransformer<Payload, Transformed>;
}

Type Parameters

  • Payload extends TSchema
  • Transformed extends Record<string, unknown> | undefined = undefined

Hierarchy (view full)

Properties

additionalValidations?: ValidationFunction<Payload, Transformed>[]

An optional array of functions that will also be used to validate the JWT.

algorithms?: Algorithm[]
allowedAud?: string | RegExp | (string | RegExp)[]
allowedIss?: string | RegExp | (string | RegExp)[]
allowedJti?: string | RegExp | (string | RegExp)[]
allowedNonce?: string | RegExp | (string | RegExp)[]
allowedSub?: string | RegExp | (string | RegExp)[]
cache?: number | boolean
cacheTTL?: number
checkTyp?: string
clockTimestamp?: number
clockTolerance?: number
complete?: boolean
discoveryEndpoint?: string
errorCacheTTL?: number | ((tokenError) => number)

Type declaration

    • (tokenError): number
    • Parameters

      • tokenError: TokenError

      Returns number

ignoreExpiration?: boolean
ignoreNotBefore?: boolean
issuer?: string
key?: string
maxAge?: number
requiredClaims?: string[]
schema: Payload

A required schema for the Payload you will be validating

The function that you will use for manipulating the JWT you are authenticating.