(gate: SignupGate)
| 233 | |
| 234 | // True when the single org has no members yet — the unclaimed first-run state. |
| 235 | const orgHasNoMembers = async (gate: SignupGate): Promise<boolean> => { |
| 236 | const auth = gate.getAuth(); |
| 237 | if (!auth) return true; |
| 238 | return (await countOrgMembers(auth, gate.organizationId)) === 0; |
| 239 | }; |
| 240 | |
| 241 | const createAuthInstance = (client: Client, getOrganizationId: () => string, gate?: SignupGate) => |
| 242 | betterAuth(makeAuthOptions(client, getOrganizationId, gate)); |
no test coverage detected