npm better-auth 1.7.28
v1.7.28

49 minutes ago

better-auth

Bug Fixes

  • Fixed /device/code returning a 500 on a user or device code collision with the Drizzle adapter by retrying with a new code (#12853)
  • Fixed concurrent email OTP requests for the same address so both emails carry the same valid code on databases with a unique verification.identifier (#12893)
  • Fixed sending a new email OTP to replace the earlier code for that address so stale codes no longer cause refusals (#12893)
  • Fixed sending a new phone number OTP to replace the earlier code so a code sent during a check stays valid (#12893)
  • Fixed verifying an unregistered phone number without signUpOnVerification to return a 400 PHONE_NUMBER_NOT_EXIST error instead of a 500 (#12893)
  • Fixed user deletion to report success only when the user is actually deleted, returning FAILED_TO_DELETE_USER when a hook vetoes or the database skips the delete (#12858)
  • Fixed /revoke-session and /admin/revoke-user-session to stop reporting success when the session survives the revocation (#12858)
  • Fixed revoking all of a user's sessions to fail when secondaryStorage cannot clear the cached sessions, instead of reporting success (#12858)
  • Fixed getSession failing when a session cached in secondaryStorage is missing its user, by reading the user from the database (#12858)
  • Fixed revoked sessions staying valid in secondary storage when a database after hook throws during password reset or user deletion (#12806)
  • Fixed generateBackupCodes to read fresh user state so sessions cached before two-factor enrollment can generate codes and revoked sessions are rejected (#12907)
  • Fixed /update-user with the username plugin rejecting your own username as already taken when called with a bearer token (#12860)

For detailed changes, see CHANGELOG

@better-auth/oauth-provider

Bug Fixes

  • Fixed Client ID Metadata Document registration treating a failed insert as a registration race when wrapped error query parameters contain words like "duplicate", and now returning the original database error (#12853)
  • Fixed the OAuth provider WWW-Authenticate: Basic challenge to include the realm parameter required by RFC 7617 (#12789)
  • Fixed client IDs containing characters not allowed by RFC 6749 causing a 500 on PostgreSQL, now returning an invalid_client response (#12854)
  • Fixed requesting an OAuth device code without a resource failing with a 500 on Prisma with PostgreSQL, CockroachDB, or MongoDB (#12854)
  • Fixed oauthProviderClient requests without a body failing with a 415 error on pages with a signed OAuth query (#12863)
  • Fixed client assertion verification to use the most recently cached key set when overlapping JWKS refreshes finish out of order (#12850)

For detailed changes, see CHANGELOG

@better-auth/core

Bug Fixes

  • Fixed user deletion to report success only when the user is actually deleted, returning FAILED_TO_DELETE_USER when a hook vetoes or the database skips the delete (#12858)
  • Fixed revoking all of a user's sessions to fail when secondaryStorage cannot clear the cached sessions, instead of reporting success (#12858)
  • Fixed the Drizzle schema check being dropped when a project resolves two copies of @better-auth/core (#12905)
  • Fixed after-commit hooks queued with onError not running when an earlier queued hook throws (#12806)
  • Fixed a timed-out JWKS refresh blocking a refresh against a newer cached key set (#12850)

For detailed changes, see CHANGELOG

auth

Bug Fixes

  • Improved auth info to redact more secret variants, including snake_case, kebab-case, uppercase, plural names, private key passphrases, and nested values (#12896)
  • Fixed auth generate for Prisma adding a duplicate back-relation when the model already has one under another name (#12896)

For detailed changes, see CHANGELOG

@better-auth/api-key

Bug Fixes

  • Fixed API key reference list writes hanging on Cloudflare Workers when an earlier request ended without releasing its lock (#12909)

For detailed changes, see CHANGELOG

@better-auth/cimd

Bug Fixes

  • Fixed metadataStaleIfError so known clients regain stored-registration fallback once another request successfully saves the same metadata fetch after a rejected save (#12850)

For detailed changes, see CHANGELOG

@better-auth/drizzle-adapter

Bug Fixes

  • Fixed the relations-v2 Drizzle adapter throwing Unexpected 'undefined' in filter value on drizzle-orm 1.0.0-rc.5 and later for joined findMany queries without a where (#12940)

For detailed changes, see CHANGELOG

@better-auth/i18n

Bug Fixes

  • Fixed user deletion to report success only when the user is actually deleted, returning FAILED_TO_DELETE_USER when a hook vetoes or the database skips the delete (#12858)

For detailed changes, see CHANGELOG

@better-auth/sso

Bug Fixes

  • Fixed SSO provider registration to enforce providersLimit even when an account already has more providers than findMany returns (#12929)

For detailed changes, see CHANGELOG

@better-auth/stripe

Bug Fixes

  • Fixed Stripe subscription lookups to filter active and trialing status in the database so the current subscription is no longer missed when canceled history is large (#12930)

For detailed changes, see CHANGELOG

Contributors

Thanks to everyone who contributed to this release:

@akshatmalik-bruh, @aliamanatali, @arhxam, @bytaesu, @elango5292, @Eternity0207, @exKAZUu, @ghazy2001, @gustavovalverde, @jonathansamines, @ping-maxwell, @Tushar-Khandelwal-2004, @umeraamir69

Full changelog: v1.7.27...v1.7.28

Don't miss a new better-auth release

NewReleases is sending notifications on new releases.