Function: requireDomain()
requireDomain(
domain):Promise<{admin:CurrentAdmin; } | {error:string; }>
Defined in: src/server/auth/access.ts:86
Server-ACTION guard (no redirect): returns the admin if they may mutate within domain, else an
error string the action returns as { ok: false, error }. Defense-in-depth so a staff member can't
call a domain's action they can't see the page for. (Owner-only actions should keep requireOwner.)
Parameters
domain
"billing" | "overview" | "business_dev" | "recruiting" | "onboarding" | "team" | "time" | "payroll" | "insights" | "settings"
Returns
Promise<{ admin: CurrentAdmin; } | { error: string; }>