Skip to content

Type Alias: GuardHandler ​

ts
type GuardHandler = (request, context) => MaybePromise<Response>;

Defined in: packages/tanstack-start/src/server.ts:57

Handles a failed check. It returns the Response the guard then throws, such as TanStack Router's redirect({ to: '/login' }), or throws itself (throw notFound()).

Parameters ​

ParameterType
requestRequest
contextGuardContext

Returns ​

MaybePromise<Response>

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