Skip to content

v0.5.1

Choose a tag to compare

@FalconiZzare FalconiZzare released this 05 Oct 12:31
· 13 commits to main since this release
8125b1c

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 with validation_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 an APIError thrown from a databaseHooks.user.create.before hook), the caller saw EMAIL_ALREADY_INVITED at create or PRE_CREATED_USER_MISSING at 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 (plus prisma generate for Prisma).

    See Schema validation on Better Auth 1.7.

  • The Better Auth CLI moved from @better-auth/cli to auth in 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