Report
Better Auth signUpEmail returns synthetic user id when email is taken
d7274b0a-9b0c-4645-b9e5-67ea335f3005
When auth.api.signUpEmail is called server-to-server (e.g. from one service POSTing to an internal Next.js route on another) with emailAndPassword.requireEmailVerification: true set, and the email is already registered, Better Auth returns a successful response containing a user.id that does NOT exist in the database. Downstream code that FK-references this id (e.g. INSERT INTO agents (user_id, ...)) hits a foreign-key violation like agents_user_id_fkey. The synthetic id has the right shape and looks like a real user id, so the bug is invisible until the FK fires.