Skip to content

Interface: GuardHandlerOptions<R> ​

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

What onUnauthenticated / onForbidden get: the call, plus the subject the guard checked (null in onUnauthenticated). R is that subject's type: SubjectRbac with the names of T in createGuards<T>().

Extends ​

Type Parameters ​

Type ParameterDefault type
RSubjectRbac

Properties ​

PropertyTypeDescriptionInherited fromDefined in
ctxanyThe procedure's context (after the middlewares that ran before the guard).GuardCallOptions.ctxpackages/trpc/src/guards.ts:42
pathstringThe procedure's path, such as post.byId.GuardCallOptions.pathpackages/trpc/src/guards.ts:44
rbacR | null--packages/trpc/src/guards.ts:53
type"query" | "mutation" | "subscription"-GuardCallOptions.typepackages/trpc/src/guards.ts:45

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