auth guard
lib/kitwright/coreOne wrapper for every entry point
Server actions and route handlers authenticate, check the permission and validate input before your code runs. Errors come back typed, never leaked.
actions.ts
export const assignJob = withAuth(
{ permission: "job:assign", input: AssignJobInput },
async ({ organizationId, input }) => assign(organizationId, input),
);