Interface: RouteGuardOptions
Defined in: packages/tanstack-start/src/server.ts:75
The options every guard takes as its last argument: the handlers plus guard. They win over the defaults.
Extends
Extended by
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
exposeRequirements? | boolean | Include the required roles/permissions in the default 403 body (required). Default: false (like spatie's display_permission_in_exception). | GuardHandlers.exposeRequirements | packages/tanstack-start/src/server.ts:71 |
guard? | string | Check in this guard instead of the server's (subject.withScope({ guard })), like spatie's role:admin,api. | - | packages/tanstack-start/src/server.ts:77 |
onForbidden? | GuardHandler | Called when the subject lacks access. Default: a 403 JSON Response. | GuardHandlers.onForbidden | packages/tanstack-start/src/server.ts:66 |
onUnauthenticated? | GuardHandler | Called when there is no subject. Default: a 401 JSON Response. For a page, return TanStack Router's redirect({ to: '/login' }): a plain 302 Response from a server function is followed by fetch, not the router. | GuardHandlers.onUnauthenticated | packages/tanstack-start/src/server.ts:64 |
