Optionaloptions: AuthHooksOptions<Ctx, InferAuthSession<Ctx["ports"]["auth"]>>Optional auth mode, session lookup, context assignment, and unauthorized response customization.
A server hook that runs before route handlers.
Create metadata-driven authentication hooks.
By default the hook reads contract.metadata.auth: "required" or true
requires an authenticated session, "optional" attaches a session when one
exists, and missing/false metadata treats the route as public. The hook
identifies a user; business authorization still belongs in policies or use
cases.
Optional auth mode, session lookup, context assignment, and unauthorized response customization.
A server hook that runs before route handlers.
Create metadata-driven authentication hooks.
By default the hook reads
contract.metadata.auth:"required"ortruerequires an authenticated session,"optional"attaches a session when one exists, and missing/false metadata treats the route as public. The hook identifies a user; business authorization still belongs in policies or use cases.