Skip to main content

Type Alias: JwtOptions

JwtOptions = object

Defined in: http-server-auth/src/types.ts:11

Properties

mapPayload?

optional mapPayload?: (payload, ctx) => AuthenticatedUser | null

Defined in: http-server-auth/src/types.ts:20

Override how the JWT payload maps to an AuthenticatedUser. Defaults to { id: payload.sub, email: payload.email }.

Receives the Koa ctx as a second argument so the mapping can do request-scoped work (e.g. reading from ctx.db).

Parameters

ParameterType
payloadRecord<string, unknown>
ctxContext

Returns

AuthenticatedUser | null


secret

secret: string

Defined in: http-server-auth/src/types.ts:12