property ApiKeyOptions.validate

Callback to validate the API key and return a principal. Return null if the key is invalid.

Type

(key: string) => Promise<IPrincipal | null>

Usage

import { type ApiKeyOptions } from "auth-plugin/src/index.ts";