Skip to content

Type Alias: GuardHandler<A> ​

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

Defined in: packages/astro/src/server.ts:77

Handles a failed check: returns the Response the guard then resolves to (a page, Astro.rewrite('/404')...).

Type Parameters ​

Type ParameterDefault type
A extends AstroContextAstroContext

Parameters ​

ParameterType
contextA
guardGuardContext

Returns ​

MaybePromise<Response>

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