Skip to main content

Type Alias: ApiTokenOptions

ApiTokenOptions = object

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

Properties

lookup

lookup: (tokenHash, ctx) => Promise<AuthenticatedUser | null>

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

Receives the SHA-256 hash of the presented token and returns the authenticated user, or null if not found / revoked.

Receives the Koa ctx as a second argument so the lookup can do request-scoped work (e.g. bumping lastUsedAt or reading ctx.db).

Parameters

ParameterType
tokenHashstring
ctxContext

Returns

Promise<AuthenticatedUser | null>