Repository navigation
v0.5.1
Users created by the plugin now pass Better Auth 1.7's validateUserInfo check, and a rejection from your own code reaches the caller with your own error code.
Fixes
-
Better Auth 1.7: Better Auth 1.7 needs every user creation to say where the user came from, and the plugin did not. So if an app configured
user.validateUserInfo, every user the plugin created was rejected withvalidation_source_missing. The plugin now passes{ method: "invite" }in all three places it creates users:- the account created up front for a private invite
- the account created when someone redeems a public invite
- the replacement account created when that up-front account has disappeared
Your check can test
source.method === "invite"to target invite sign-ups. See the recipe. -
create / redeem: When your own code rejected a user the plugin was creating (an error from
validateUserInfo, or anAPIErrorthrown from adatabaseHooks.user.create.beforehook), the caller sawEMAIL_ALREADY_INVITEDat create orPRE_CREATED_USER_MISSINGat redeem. It now reaches the caller unchanged, with your status and code.
Compatibility
-
Tested against Better Auth 1.6 and 1.7. The minimum supported version stays at
better-auth >= 1.4.0. -
Better Auth 1.7 checks the database schema when it starts, and auth requests fail while the check finds a mismatch. After upgrading:
- Kysely: run
npx auth migrate. - Prisma or Drizzle: run
npx auth generate, then your ORM's migration (plusprisma generatefor Prisma).
- Kysely: run
-
The Better Auth CLI moved from
@better-auth/clitoauthin 1.7. The docs now show both.
Migration notes
No schema changes, no new error codes, and no API or response-shape changes. If you already use validateUserInfo and it checks source.method, decide how it should treat "invite". A check that only allows methods it knows about will now see invite sign-ups and could reject them.
Full changelog: v0.5.0...v0.5.1