@foal/jwt

Last updated 12 days ago

Table of contents

index.ts

Functions

JWTOptional

function JWTOptional(options: JWTOptions = {}, verifyOptions: VerifyOptions = {}): HookDecorator;

Parameters

Name

Type

Default value

options

JWTOptions

{}

verifyOptions

VerifyOptions

{}

Return type

HookDecorator

JWTRequired

function JWTRequired(options: JWTOptions = {}, verifyOptions: VerifyOptions = {}): HookDecorator;

Parameters

Name

Type

Default value

options

JWTOptions

{}

verifyOptions

VerifyOptions

{}

Return type

HookDecorator

Interfaces

JWTOptions

interface JWTOptions {
user?: ((id: string | number) => Promise<any>) | undefined;
blackList?: ((token: string) => boolean | Promise<boolean>) | undefined;
}

Properties

Name

Type

Optional

user

((id: string | number) => Promise) | undefined

true

blackList

((token: string) => boolean | Promise) | undefined

true

InterfaceDeclaration-0: index.md#jwtoptions