Interface: GuardHandlers<R>
Defined in: packages/trpc/src/guards.ts:62
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
R | SubjectRbac |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
exposeRequirements? | boolean | Include the required roles/permissions in the default error (required in its body). Default: false (like spatie's display_permission_in_exception). | packages/trpc/src/guards.ts:71 |
onForbidden? | GuardHandler<R> | Called when the subject lacks access. Default: a TRPCError FORBIDDEN. | packages/trpc/src/guards.ts:66 |
onUnauthenticated? | GuardHandler<R> | Called when there is no subject (ctx.rbac is null). Default: a TRPCError UNAUTHORIZED. | packages/trpc/src/guards.ts:64 |
