Type Alias: GuardHandler<Req>
ts
type GuardHandler<Req> = (request, reply, context) => unknown;Defined in: packages/fastify/src/guards.ts:49
Must send a reply (e.g. reply.code(403).send(...)) or throw (e.g. an httpErrors error). Req is the request it gets: GuardRequest<T> in createGuards<T>(), so request.rbac has the names of T there.
Type Parameters
| Type Parameter | Default type |
|---|---|
Req | FastifyRequest |
Parameters
| Parameter | Type |
|---|---|
request | Req |
reply | FastifyReply |
context | GuardContext |
Returns
unknown
