Skip to content

Interface: GuardHandlers<C> ​

Defined in: packages/hono/src/guards.ts:52

Extended by ​

Type Parameters ​

Type ParameterDefault type
CContext

Properties ​

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

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