Beignet API reference
    Preparing search index...

    Type Alias AuthRouteHooks<Ctx, AddedCtx>

    Route-scoped auth hook set.

    type AuthRouteHooks<Ctx, AddedCtx extends object & { gate?: never }> = {
        optional: () => RouteHook<Ctx, Partial<AddedCtx>>;
        public: () => RouteHook<Ctx, Record<string, never>>;
        required: () => RouteHook<Ctx, AddedCtx>;
    }

    Type Parameters

    • Ctx
    • AddedCtx extends object & { gate?: never }
    Index
    optional: () => RouteHook<Ctx, Partial<AddedCtx>>

    Resolve auth when present and add optional auth fields to the handler ctx.

    public: () => RouteHook<Ctx, Record<string, never>>

    Mark a route as intentionally public.

    required: () => RouteHook<Ctx, AddedCtx>

    Require auth and add authenticated fields to the handler ctx.