Packages

better-auth

1.7.25 · 14 Nov 2026MIT21M / weekRepositoryHomepagenpmAtom feed

Your version

1.6.17

12 Jun 2026Where it was published

1.7.27 is the newest release of 1.x.

In short

3 new34 fixed

Security

Release note

The section about better-auth of a note shared by several packages.

better-auth

Features

  • Added an experimental oauthPopup plugin for popup-based OAuth sign-in, enabling sign-in inside cross-site iframes by completing the OAuth flow in a popup and passing the session token back via the bearer plugin

Bug Fixes

  • Fixed getCookieCache to return null for an expired session instead of stale data, so middleware no longer treats an expired signed cookie as a live session.

  • Fixed a race condition where a delete-account confirmation link could delete the account more than once when its callback was opened concurrently.

  • Fixed a race condition where a one-time token could be redeemed for a session more than once when redeemed concurrently.

  • Fixed a race condition where a password reset token could change the password more than once when used from concurrent requests.

  • Fixed Reddit sign-in to assign a non-routable placeholder address (<id>@reddit.invalid) to users with no email, instead of one on the real reddit.com domain, preventing accidental mailbox matches. The address stays unverified, and mapProfileToUser can supply a real email.

  • Fixed Sign-In with Ethereum to prevent a nonce from being used to sign in more than once when submitted from concurrent requests.

  • Added internalAdapter.reserveVerificationValue for atomic single-use markers, ensuring exactly one concurrent caller succeeds and the rest see the marker as already taken, hardening replay protection across all verification flows. Database-backed storage is atomic; secondary-storage-only mode is best-effort.

  • Added the optional incrementOne adapter method and SecondaryStorage.increment for atomic counter updates with conditional row guards, enabling strict enforcement of rate limits and usage counters. Adapters without native support fall back to a transaction-based approach.

  • Fixed expired two-factor sign-in challenges from completing login, and prevented the same challenge from creating more than one session when verified concurrently.

  • Fixed captcha provider verification to time out after 10 seconds and fail closed, preventing a slow or unreachable provider from blocking requests indefinitely.

  • Fixed /delete-user/callback to reject account deletion when the session has been revoked server-side, instead of proceeding within the cookie-cache window. Deployments that keep sessions only in the cookie are unaffected.

  • Fixed concurrent requests from slipping past the configured rate limit, resolved unbounded memory growth in the in-memory rate-limit store, and made the database backend remove expired entries automatically. A custom rate-limit storage may implement a new optional consume method for strict enforcement.

  • Fixed team deletion to preserve pending invitations, which now drop the removed team and remain valid for their remaining teams or as organization-level invitations.

  • Downgraded expected auth validation failures from error logs to warnings.

  • Fixed expired MCP access tokens from being accepted, and restricted refresh token acceptance to authorizations that included the offline_access scope.

  • Fixed team member limits to be enforced on addMember and add-team-member paths, preventing teams from exceeding their maximumMembersPerTeam cap, and ensured a rejected addMember does not create the organization member

  • Fixed generic OAuth sign-in for providers whose userinfo response lacks a sub or id field when mapProfileToUser derives the account id

  • Fixed single-use credentials, counters, and replay markers to be handled atomically under concurrent requests

  • Fixed stateless OAuth deployments to correctly read account info and tokens when different server instances handle sign-in and subsequent requests

  • Fixed admin.setUserPassword to create a credential account for users who only have social or magic-link accounts, enabling direct password assignment without manually modifying the account table

  • Fixed updateSession to accept custom session fields inferred from inferAdditionalFields

  • Fixed duplicate /get-session requests triggered by focus and other browser events, stabilized client hook data references to reduce unnecessary re-renders, and resolved session state getting stuck loading after unmounting during an in-flight request

  • Fixed the OpenAPI schema to mark model id fields as required

  • Fixed updateMemberRole to reject unknown or malformed role values, validating them against configured static and dynamic roles

  • Fixed a memory leak where the JWKS cache grew on every access token verification.

  • Fixed Google One Tap to require a configured client ID and reject ID tokens issued for a different application, preventing unauthorized sign-ins.

  • Fixed a race condition where polling for a device-authorization token could redeem the same approved device code more than once.

  • Fixed account cookie handling when switching users in the same browser, preserving the fresh cookie instead of expiring it from stale request state.

  • Refactored role.authorize control flow without changing existing authorization behavior

  • Fixed a race condition where submitting the same email OTP from concurrent requests could sign in more than once or exceed the attempt limit.

  • Fixed a race condition where submitting the same phone-number OTP from concurrent requests could sign in more than once or exceed the attempt limit.

  • Fixed a race condition where submitting the same two-factor OTP from concurrent requests could sign in more than once or exceed the attempt limit.

  • Improved the Have I Been Pwned plugin to check submitted passwords on more endpoints by default, including email-OTP and phone-number reset-password routes and admin create-user and set-user-password routes.

  • Fixed multi-session set-active and revoke endpoints to only act on sessions the caller holds a signed cookie for, preventing unauthorized activation or revocation of other sessions.

  • Fixed the OIDC /oauth2/endsession endpoint to reject cross-site GET logout requests carrying only a session cookie, while leaving logout authenticated by a valid id_token_hint unaffected.

  • Fixed WeChat sign-in to succeed without an email address by assigning a stable placeholder, matching the behavior expected from the default configuration.

For detailed changes, see CHANGELOG

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.