Kaizen
Browse modulesTenancyFunctions

Function: requireCurrentTenantId()

function requireCurrentTenantId(): string;

Defined in: server/tenancy/context.ts:81

The active tenant id, or throw — the fail-closed source of the tenant a WRITE belongs to. Stamp requireCurrentTenantId() on every create of a tenant model so the owning tenant is set in the one Prisma-touching layer. Throws outside a tenant binding so a tenant write can never land un-scoped (seeds bypass repositories and pass the tenant explicitly).

Returns

string

On this page