From cc075d531b29e9001877cd4f45fdb8eb8028e6da Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 2 Jun 2026 21:57:15 +0300 Subject: [PATCH] Allow unverified users to create a clinic Since email verification is no longer enforced at sign-in, gating organization creation on `user.emailVerified` blocked onboarding with "You are not allowed to create a new organization". Allow any signed-in user to create a clinic; re-tie to emailVerified when verification returns. Co-Authored-By: Claude Opus 4.8 --- backend/src/auth.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/auth.ts b/backend/src/auth.ts index 7f66126..0e1d0b4 100644 --- a/backend/src/auth.ts +++ b/backend/src/auth.ts @@ -58,7 +58,10 @@ export const auth = betterAuth({ ac, roles, creatorRole: "owner", - allowUserToCreateOrganization: async (user) => user.emailVerified === true, + // Verification isn't enforced right now (see emailAndPassword above), so + // any signed-in user may create a clinic. Re-tie this to + // `user.emailVerified === true` when verification is re-enabled. + allowUserToCreateOrganization: true, membershipLimit: 200, invitationExpiresIn: WEEK, sendInvitationEmail: async (data) => {