Skip to main content

Function: bootstrapProfile()

bootstrapProfile(userId, email, fullName): Promise<BootstrappedProfile>

Defined in: src/server/auth/profile.ts:17

Ensure a profiles row exists for a freshly-authenticated admin (called from the OAuth callback, after the email domain has been verified). The first admin to sign in for a company becomes the owner; subsequent admins are staff (the owner promotes/manages from there).

Runs with the service client (bypasses RLS) because the user has no profile yet, so RLS would otherwise block the read/insert. Single-tenant for now: assigns to the one seeded company.

Parameters

userId

string

email

string

fullName

string | null

Returns

Promise<BootstrappedProfile>