Skip to content

Interface: GuardHandlers<Req> ​

Defined in: packages/fastify/src/guards.ts:54

Extended by ​

Type Parameters ​

Type ParameterDefault type
ReqFastifyRequest

Properties ​

PropertyTypeDescriptionDefined in
exposeRequirements?booleanInclude the required roles/permissions in the default 403 body. Default: false (like spatie's display_permission_in_exception).packages/fastify/src/guards.ts:63
onForbidden?GuardHandler<Req>Called when the subject lacks access. Default: 403 JSON.packages/fastify/src/guards.ts:58
onUnauthenticated?GuardHandler<Req>Called when there is no subject (request.rbac is null). Default: 401 JSON.packages/fastify/src/guards.ts:56

Released under the MIT License. Inspired by spatie/laravel-permission.