npm better-auth 1.7.21
v1.7.21

32 minutes ago

Important

Action required

  • If you use SCIM with an adapter that has no native transactions, switch to an adapter with native transactions to provision users and groups. (#12413)
  • If you use the MongoDB adapter and an index build fails because of duplicate values, missing createIndex permission, or a conflicting index on the same field, fix the cause and restart. (#12299)
  • If you rely on update changing every row that matches a non-unique filter, use updateMany instead. (#12390)

better-auth

Bug Fixes

  • Fixed plugin packages importing from the better-auth root, so bundlers no longer emit unused Kysely chunks when used with better-auth/minimal (#12404)
  • fix(core): use ObjectId-shaped derived ids for Prisma ObjectId columns (#12126)
  • Fixed the device approval page showing a valid code as invalid when the same signed-in user looked it up twice at once, such as under React Strict Mode (#12392)
  • Fixed sign-ins with a genericOAuth provider using discoveryUrl and OAuth provider requests using resources hanging on Cloudflare Workers (#12395)
  • Fixed Generic OAuth to send authorizationHeaders on access token refresh, added an optional headers input to refreshAccessToken and refreshAccessTokenRequest, and prevented invalid combined headers with differently cased client authentication headers (#12401)
  • fix(generic-oauth): send discoveryHeaders to same-origin JWKS and keep them on the discovery origin (#12179)
  • Fixed intermittent schema does not exist and relation does not exist errors on PostgreSQL during the startup schema check and npx auth@latest migrate when other schemas are dropped concurrently (#11912)
  • fix(sign-up): send sign-up emails after the transaction commits (#12052)
  • Fixed SIWE verification to stop exposing internal error messages in its 401 response and log them on the server instead (#12403)

For detailed changes, see CHANGELOG

@better-auth/oauth-provider

Bug Fixes

  • Fixed the OAuth provider returning [object Promise] instead of the refresh token when formatRefreshToken.encrypt is async (#12409)
  • fix(core): use ObjectId-shaped derived ids for Prisma ObjectId columns (#12126)
  • Fixed sign-ins with a genericOAuth provider using discoveryUrl and OAuth provider requests using resources hanging on Cloudflare Workers (#12395)
  • fix(oauth-provider): report rejected post-logout redirect URIs as invalid_redirect_uri (#12391)
  • fix(oauth-provider): return invalid_grant when reuse revokes an in-flight issuance (#11911)
  • Fixed OAuth provider consent denial to redirect to the client only while the client is enabled and its redirect_uri is still valid (#12385)
  • fix(oauth-provider): revoke in-flight access tokens on adapters without foreign keys (#12389)

For detailed changes, see CHANGELOG

@better-auth/core

Bug Fixes

  • Fixed null filters on id and reference fields being coerced to 0 when advanced.database.generateId is "serial" (#12402)
  • Fixed authentication requests hanging on Cloudflare Workers when the request that started schema validation ended before validation finished (#11716)
  • fix(core): use ObjectId-shaped derived ids for Prisma ObjectId columns (#12126)
  • Fixed Generic OAuth to send authorizationHeaders on access token refresh, added an optional headers input to refreshAccessToken and refreshAccessTokenRequest, and prevented invalid combined headers with differently cased client authentication headers (#12401)
  • Fixed telemetry to report Cloudflare Workers as workerd instead of node when nodejs_compat is enabled, and exported the runtime detection from @better-auth/core/env (#12425)

For detailed changes, see CHANGELOG

@better-auth/sso

Bug Fixes

  • Fixed plugin packages importing from the better-auth root, so bundlers no longer emit unused Kysely chunks when used with better-auth/minimal (#12404)
  • fix(sso): extend the refreshed session's own SAML logout record (#12424)
  • fix(sso): keep SAML Single Logout working after session refresh (#12417)
  • Fixed SAML replay protection to reject a signed response resubmitted with its assertion ID written as XML character references when allowIdpInitiated: true or enableInResponseToValidation: false is set (#12421)

For detailed changes, see CHANGELOG

@better-auth/prisma-adapter

Bug Fixes

  • fix(core): use ObjectId-shaped derived ids for Prisma ObjectId columns (#12126)
  • Fixed Prisma adapter updates comparing a unique field with null failing with a validation error, and update now changes only one matching row (#12390)
  • Fixed the Prisma adapter with provider: "mongodb" to match contains, starts_with, ends_with, and case-insensitive filters as literal text instead of regex patterns (#11807)

For detailed changes, see CHANGELOG

@better-auth/scim

Bug Fixes

  • Fixed plugin packages importing from the better-auth root, so bundlers no longer emit unused Kysely chunks when used with better-auth/minimal (#12404)
  • fix(scim): handle Groups with more than 100 members (#12070)
  • Fixed apps using the SCIM plugin on adapters without native transactions, such as Cloudflare D1, failing at startup; /scim/v2 requests now return 501 Not Implemented on those adapters (#12413)

For detailed changes, see CHANGELOG

@better-auth/electron

Bug Fixes

  • Fixed failed deep link authentication in Electron to be logged instead of causing an unhandled promise rejection in the main process (#12409)
  • Fixed plugin packages importing from the better-auth root, so bundlers no longer emit unused Kysely chunks when used with better-auth/minimal (#12404)

For detailed changes, see CHANGELOG

@better-auth/api-key

Bug Fixes

  • Fixed plugin packages importing from the better-auth root, so bundlers no longer emit unused Kysely chunks when used with better-auth/minimal (#12404)

For detailed changes, see CHANGELOG

@better-auth/expo

Bug Fixes

  • Fixed plugin packages importing from the better-auth root, so bundlers no longer emit unused Kysely chunks when used with better-auth/minimal (#12404)

For detailed changes, see CHANGELOG

@better-auth/kysely-adapter

Bug Fixes

  • Fixed intermittent schema does not exist and relation does not exist errors on PostgreSQL during the startup schema check and npx auth@latest migrate when other schemas are dropped concurrently (#11912)

For detailed changes, see CHANGELOG

@better-auth/mongo-adapter

Bug Fixes

  • Added indexes in the MongoDB adapter for schema fields marked unique or index, preventing duplicate users from concurrent sign-ups with the same email (#12299)

For detailed changes, see CHANGELOG

@better-auth/passkey

Bug Fixes

  • fix(passkey): accept exact trusted origins under a wildcard allowed host (#12388)

For detailed changes, see CHANGELOG

@better-auth/stripe

Bug Fixes

  • Fixed plugin packages importing from the better-auth root, so bundlers no longer emit unused Kysely chunks when used with better-auth/minimal (#12404)

For detailed changes, see CHANGELOG

@better-auth/telemetry

Bug Fixes

  • Fixed telemetry to report Cloudflare Workers as workerd instead of node when nodejs_compat is enabled, and exported the runtime detection from @better-auth/core/env (#12425)

For detailed changes, see CHANGELOG

@better-auth/test-utils

Bug Fixes

  • Fixed the adapter test for findMany with multiple operators to create users from generated data like other adapter tests (#12409)

For detailed changes, see CHANGELOG

Contributors

Thanks to everyone who contributed to this release:

@ArjunCodess, @bytaesu, @ghazy2001, @gustavovalverde, @hardikguptaofficialgit, @ItzSudhan, @lakshya-dhariwal, @mallachari, @umeraamir69

Full changelog: v1.7.20...v1.7.21

Don't miss a new better-auth release

NewReleases is sending notifications on new releases.