Repository navigation
fix(deps): update better-auth to v1.7.23 - #282
Open
renovate[bot] wants to merge 2 commits into
Open
renovate[bot] wants to merge 2 commits into
renovate[bot] wants to merge 2 commits into
Conversation
renovate
Bot
force-pushed
the
renovate/better-auth
branch
2 times, most recently
from
November 16, 2026 15:51
b9f6d91 to
c1af0b8
Compare
renovate
Bot
force-pushed
the
renovate/better-auth
branch
from
November 16, 2026 15:54
de918a7 to
721984e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
1.7.1→1.7.231.7.1→1.7.231.7.1→1.7.23Release Notes
better-auth/better-auth (@better-auth/core)
v1.7.23Compare Source
Patch Changes
#12501
cfa73e9Thanks @gustavovalverde! -requireMcpAuthnow reads the signing keys from the auth instance instead of requesting its own/jwksendpoint, so MCP routes served from the same app as the auth server no longer fail with a 500 on runtimes that block requests to their own hostname, such as a single Cloudflare Worker.Set
jwksUrlto keep fetching the keys over HTTP.#12480
c10b35dThanks @gustavovalverde! - Theadvanced.database.validateSchemaJSDoc now says validation runs when the auth instance is first used, and that adapters other than Kysely, Drizzle, and Prisma skip it with a log message.v1.7.22Compare Source
Patch Changes
#12333
6536174Thanks @bytaesu! - FixgetSessionfailing with "Failed to get session" when auser.additionalFieldsentry references a table outside the Better Auth schema, including with database joins enabled on Drizzle and Prisma. Join resolution now matchesreferences.modelagainst schema keys only.#12432
262adc0Thanks @gustavovalverde! - Reject introspected access tokens that fail claim validation with a 401UNAUTHORIZEDerror. WhenremoteVerifyintrospection reported an active token whoseaud,iss,exp, ornbfclaim did not pass the configured checks,verifyBearerTokenandverifyAccessTokenRequestthrew a plainError, so resource servers answered with a 500 instead of aWWW-Authenticatechallenge. Expired tokens now reporttoken expiredand other claim failures reportinvalid access token, matching local JWKS verification.#12445
e9d8e59Thanks @gustavovalverde! - Resource-server challenges no longer turn a rejected request into a 500, and they now tell clients when the token they sent is invalid.createResourceServerChallengeused to throw when anerror_descriptioncontained a character that RFC 6750 does not allow in that parameter. Better Auth's own DPoP messageDPoP proof typ must be "dpop+jwt"was one of them. The description is now fitted into the allowed characters:"becomes', other disallowed characters become spaces, and an empty result is left out. Invalid scope tokens inchallengeScopesstill throw.When the request presented a token that failed verification, the 401 Bearer challenge now carries
error="invalid_token"and anerror_description, following RFC 6750 §3 and §3.1. A request without a token still gets no error code.verifyBearerTokenandverifyAccessTokenRequestnow seterror: "invalid_token"anderror_descriptionon their expired, invalid, inactive, and unreadable token errors, and the challenge's response body includes both fields alongsidemessage.v1.7.21Compare Source
Patch Changes
#12126
4739122Thanks @hardikguptaofficialgit! - On Prisma with MongoDB, when your id columns use@db.ObjectId, magic link and email OTP sign-in for users with an unverified email no longer fail with a 500 (Malformed ObjectID). SAML sign-in, DPoP-bound OAuth requests, andprivate_key_jwtclient authentication are fixed the same way, and Sign-In with Ethereum now keeps the email the user supplied instead of a placeholder. Setups with plainStringid columns and other databases are unaffected.#12401
c3a94c5Thanks @gustavovalverde! - Generic OAuth providers configured withauthorizationHeadersnow send those headers when refreshing an access token, not only when exchanging the authorization code. Before, a provider whose token endpoint requires one of those headers accepted the sign-in but rejected every refresh. Providers withoutauthorizationHeadersare unaffected.refreshAccessTokenandrefreshAccessTokenRequestfrom@better-auth/core/oauth2accept an optionalheadersinput for providers that need extra headers on refresh. Client authentication headers still take precedence over it.Extra headers whose names differ only in case from a client authentication header, such as
Authorizationwithauthentication: "basic", no longer produce a combined, invalid header on the code exchange or refresh. Client authentication replaces them, including headers a customtokenEndpointAuthhook sets in any casing.#11716
1a79da5Thanks @bytaesu! - Authentication requests no longer hang on Cloudflare Workers when the request that started schema validation ends before validation finishes. On Workers, each request now runs its own schema lookup until one completes.#12402
2d10ae7Thanks @gustavovalverde! - Withadvanced.database.generateId: "serial", filtering anidor reference field withnullnow compares it withnull. Before, thenullbecame0, soeq nullmatched no row and, on the memory adapter,ne nullalso matched rows where the field was unset.#12425
ef4d4f7Thanks @bytaesu! - Telemetry now reports Cloudflare Workers asworkerdinstead ofnodewhennodejs_compatis enabled.@better-auth/core/envexports the runtime detection it uses.v1.7.20Compare Source
Patch Changes
#11904
a3f50d0Thanks @gustavovalverde! - OAuth provider deployments served over plain HTTP on a private network, such as a LAN address, a VPN, or a private DNS name, can now accepthttpredirect URIs through the newallowInsecureRedirectUrioption. Returntruefrom it for origins you control. The same option lets web clients uselocalhostcallbacks during development. Without the option, redirect URI validation is unchanged.If your issuer (
baseURL, orjwt.issuerwhen set) useshttpon a non-loopback host, discovery and theissauthorization response parameter now report it as configured instead of rewriting it tohttps. They now match the issuer in issued tokens, so OpenID Connect sign-ins no longer fail on the mismatch. If a proxy terminates TLS in front of Better Auth, setbaseURLto the publichttpsURL.When an authorization request uses a registered
httpredirect URI that the HTTPS policy rejects, the error now appears on the server error page instead of being redirected to that URI.Client registration and updates now reject post-logout redirect URIs that contain credentials, such as
https://user:pass@example.com/logged-out, matching the existing rule for redirect URIs.v1.7.19Compare Source
Patch Changes
#12317
8412a5fThanks @bytaesu! - Failed fallback join queries are now reported only through the configured logger, instead of also printing the raw database error (including SQL and bound values) withconsole.error.#12369
34ee100Thanks @bytaesu! -getAccessTokenandrefreshTokennow fail when a provider refuses a token refresh with a 200 status, as GitHub does, instead of returning the expired access token.v1.7.18Compare Source
Patch Changes
9342a73Thanks @gustavovalverde! - Resource servers that setverifyOptions.typ, such as"at+jwt", together withremoteVerifynow accept tokens that introspection reports as active. Previously every token was rejected, because thetypcheck ran against the introspection response, which has no JWT header. The local JWT check still enforcestyp. That check runs only whenjwksUrlis set andremoteVerify.forceis nottrue. Otherwisetypis not enforced, and the introspection result alone decides. This also fixes MCP servers that setjwtVerifyOptions.typwithremoteVerify.v1.7.17Compare Source
v1.7.16Compare Source
Patch Changes
#12198
f25081aThanks @bytaesu! - Generic OAuth providers whose discovery document has ajwks_urinow reject a user profile whosesubdiffers from the ID token'ssub. Direct ID-token sign-in and linking with a generic OAuth provider now resolve the profile from the verified ID token only and ignore a submitted access or refresh token.#12198
f25081aThanks @bytaesu! - Account linking and new OAuth users now count an email as verified only when the provider claim istrueor the string"true", which covers generic OAuth, Cognito, and Microsoft Entra ID claims sent as strings. Any otheremailVerifiedvalue, including a non-boolean value returned frommapProfileToUsersuch as1, now reads as unverified.#12198
f25081aThanks @bytaesu! - The Zoom social provider now applies its configured provider options, sodisableSignUp,requireEmailVerification, andoverrideUserInfoOnSignIntake effect for Zoom sign-ins.v1.7.15Compare Source
Patch Changes
9ef0c5bThanks @bytaesu! - Built-in social providers no longer follow HTTP redirects on token exchange, refresh, verification, and signing key (JWKS) requests, matching the other server-side OAuth requests.v1.7.14Compare Source
Patch Changes
2947ab7Thanks @honuuk! - Kakao sign-in now passesloginHintto Kakao, so the Kakao Account login page opens with the ID field prefilled.v1.7.13Compare Source
Patch Changes
#11997
2712441Thanks @bytaesu! - The Cloudflare provider now acceptstokenEndpointAuth: { method }. The existingtokenEndpointAuthMethodoption is marked as deprecated and remains supported for backward compatibility.#11948
1cf4b2cThanks @allenzhou101! - Allow the Vercel social provider to configure token endpoint authentication, including dynamic OIDC tokens and private key JWT client assertions, without replacing the built-in sign-in flow.v1.7.12Compare Source
Patch Changes
#11924
681aa5cThanks @bytaesu! -APIError.from()accepts{ cause }as a third argument to keep the underlying error for server-side callers without exposing it in the response.#11931
4bc78baThanks @bytaesu! - ID token sign-in now rejects tokens when the provider has no client ID, because their audience cannot be checked and a token issued to another app would otherwise be accepted. SetclientIdon the provider to every client ID your apps sign in with.#11919
876608dThanks @bytaesu! - A custom FacebookgetUserInfono longer receives client-submitted access tokens issued to another Facebook app, and ID tokens missingexporiatare now rejected.#11918
083a743Thanks @alpcanaydin! - FixmapProfileToUserfailing to typecheck underexactOptionalPropertyTypeswhen it returnsundefinedforname,emailorimage, for example to drop the provider's profile picture.#11920
492134aThanks @bytaesu! - Restore the Twitch and Paybin ID token handling from before 1.7.11, which made account info fail once the ID token stored at sign-in expired.v1.7.11Compare Source
Patch Changes
#11623
ce96569Thanks @cpojer! - Reduce installation size by removing the semantic conventions production dependency while preserving all instrumentation attribute keys.#11907
2f6ca3fThanks @bytaesu! - Fix plugins whoseinitreturnsoptions: undefined, such astestUtils(), failing to typecheck whenexactOptionalPropertyTypesis enabled.#11884
dfd8dd2Thanks @bytaesu! - Twitch and Paybin sign-in now verify ID token signatures and identity claims before mapping profiles, with 30 seconds of clock tolerance. Custom Paybin issuers must expose RS256 signing keys at<issuer>/.well-known/jwks.json.v1.7.10Compare Source
Patch Changes
#11612
fedd055Thanks @vhinayindia! - If your resource server verifies access tokens withverifyAccessTokenRequestorverifyBearerTokenand ajwksUrl, including through the MCP plugin, a key set that cannot be reached at all, for example a refused connection, now throws an error. Before, the token was rejected as invalid with 401 "no token payload", which hid the outage. A key set that answers with an HTTP error already threw.With
remoteVerifyconfigured, such a failure no longer falls back to remote introspection.The OAuth provider's
/oauth2/introspect,/oauth2/userinfoand/oauth2/revokebehave the same way with the JWT plugin'sjwks.remoteUrl: they return 500 instead of reporting the token as invalid.#11805
bbd0a19Thanks @gustavovalverde! - Servers that verify JWTs against a key set now refetch that key set at most once every 30 seconds per server process when a token names a key ID (kid) the cached set does not contain. This covers the OAuth provider plugin's introspection, revocation, UserInfo, and logout endpoints, and resource servers that callverifyAccessTokenRequestorverifyBearerTokenwithjwksUrl. Previously every such token caused a new fetch: a remote request withjwksUrlorjwks.remoteUrl, or otherwise a read of thejwkstable. Anyone could send tokens with made-upkidvalues to force one fetch per request, and the UserInfo endpoint needs no client credentials.Concurrent verifications now share one fetch, and a key set fetch that takes longer than 5 seconds fails with a
JWKSTimeouterror instead of waiting indefinitely.A token signed with a newly published key still verifies without waiting for the 5-minute cache to expire. It can be rejected for up to 30 seconds if the key set was already refetched for another unknown
kidin that time. No configuration change is needed.v1.7.9Compare Source
v1.7.8Compare Source
Patch Changes
#11512
4175b34Thanks @bytaesu! - Align the installed@better-auth/utilsversion withbetter-callwhile accepting^0.4.2 || ^0.5.0across official package peers.#11592
435645eThanks @drewsephski! - Fix Atlassian user info errors being logged as coming from Figma.#11625
369176eThanks @gustavovalverde! - Fixed single-use checks for apps that setadvanced.database.generateId: "uuid". Default id generation is unaffected, and no migration is needed.private_key_jwtclient authentication, and magic link or email OTP sign-ins that adopt an unverified account failed with aNOT NULLerror on theidcolumn. They now work. SIWE sign-in ignored theemailfield and used the wallet-derived address; it now uses the supplied email when no other account has it.With
generateId: "serial", behavior is unchanged: these checks need string ids, and Better Auth now logs a warning the first time one of these flows runs.#11749
e78f15aThanks @gustavovalverde! - ID token verification now allows 30 seconds of clock difference between your server and the identity provider when checkingexp,nbf, andiat. Previously, a provider whose clock ran even slightly ahead (for example, annbfset a fraction of a second in the future) made sign-in fail. This affected generic OAuth providers configured withdiscoveryUrlsince 1.7.0, ID token sign-in with the built-in social providers, and Google One Tap. Tokens up to 30 seconds pastexpare now also accepted. No configuration change is needed. A customverifyIdTokenreplaces this check and must set its own tolerance, and the SSO plugin's OIDC sign-in is unchanged.#11663
60525e0Thanks @kaiizer777! - Fixed Microsoft Entra ID sign-in with an ID token (signIn.socialwithidToken, and linking an account with an ID token) rejecting every token. Microsoft publishes its signing keys without analgfield, which made verification fail. Those keys are now treated as RS256, and Microsoft ID tokens signed with any other algorithm are rejected. The redirect sign-in flow was not affected.#11515
916ef5cThanks @BilalAtique! - If you passclienttomongodbAdapteron a replica set, concurrent requests that write the same documents no longer fail with a 500. Before, MongoDB aborted all but one of them with a write conflict, so a SCIM directory that provisions several users at once returned 500 for most of them. The adapter now retries such a transaction, as MongoDB requires, for up to 120 seconds or until yourMongoClient'stimeoutMS. Under contention a request can take longer instead of failing.A retry runs the work again.
databaseHooksbeforehooks can run more than once for one request, andafterhooks still run once, after the commit. Work that the request does outside the database before it commits can also repeat on a retried request. For example, an email sign-up can send its verification email twice. Requests that succeed on the first attempt are unaffected, and so are other adapters.#11718
1d95ebfThanks @bytaesu! - Fix missing device sessions and failed automatic session switching after cache eviction whenstoreSessionInDatabaseis enabled andpreserveSessionInDatabaseis disabled. Automatic switching now follows the order of held sessions, and large lists or sessions whose users no longer exist no longer cause valid sessions to disappear.#10956
6214610Thanks @disbell! - Native OAuth clients and Client ID Metadata Documents can now use custom-scheme redirect URIs with a host and a path, such as Cursor'scursor://anysphere.cursor-mcp/oauth/callback. Previously, only the authority-free reverse-domain form, such ascom.example.app:/callback, was accepted, and these registrations failed withinvalid_redirect_uri.Cursor also omits
application_typewhen it registers, so thewebdefault still rejects it. To accept Cursor, set the newclientRegistrationDefaultApplicationTypeoption to"infer". A dynamic registration that omitsapplication_typethen becomesnativewhen any of its redirect URIs uses a custom scheme, and every redirect URI must pass the native rules. Setting"native"treats every registration that omits the field asnative. The default remains"web", and anapplication_typethe client sends is never overridden.Pairwise clients (
subject_type: "pairwise") cannot use these host-bearing custom-scheme redirect URIs. Web clients are unaffected: they still accept onlyhttpsredirect URIs on non-loopback hosts.#11626
67743edThanks @gustavovalverde! - Password resets and password changes no longer keep the new password when revoking the user's sessions fails. WithrevokeSessionsOnPasswordResetorrevokeOtherSessions, database sessions are revoked and the password is saved in one transaction when transactions are enabled for the adapter, so a failure leaves the old password and sessions in place. Sessions in secondary storage are still removed after commit, on a best-effort basis. This covers/reset-password, the email OTP and phone number reset endpoints, and/change-password.onPasswordResetnow runs after sessions are revoked, so a throwing callback no longer leaves them active, and a callback that lists the user's sessions no longer sees the revoked ones.#11712
c46d2a6Thanks @bytaesu! - Fix misleading errors for invalid runtime-provided AsyncLocalStorage values in the edge and browser fallback, and recognize AsyncLocalStorage initialized after importing Better Auth but before first use.#11643
92dfceaThanks @gustavovalverde! - A sign-up that fails after its session is created no longer leaves that session in secondary storage. WithstoreSessionInDatabaseenabled andpreserveSessionInDatabaseoff, the secondary-storage copy is written only after the sign-up commits, and listing a user's sessions now reads the database, so a session whose cached copy failed to write is still listed and revoked. With other secondary-storage settings, sign-up, passkey registration and SSO sign-in withresolveUserkeep the session write inside their transaction, so a storage failure rolls back the new user, passkey or account instead of keeping them without a session. A session revoked by asession.create.afterdatabase hook also stays revoked.#11645
a9f455dThanks @gustavovalverde! - On database adapters without transactions enabled, a request that fails after writing data now still runs the after hooks for those writes, such asdatabaseHooksaftercallbacks and secondary-storage session cleanup. Previously they were skipped even though the writes were kept.#11711
9725f1bThanks @bytaesu! - Fix subsequent authentication requests hanging after async context initialization is interrupted.v1.7.7Compare Source
v1.7.6Compare Source
Patch Changes
631ac29Thanks @bytaesu! - Preserve logical model identity when a custom model name matches another schema key.v1.7.5Compare Source
Patch Changes
#11203
cb627ebThanks @dshukertjr! - Add adatabase.schemaNameoption for direct PostgreSQL connections. When set, the adapter and the CLI qualify every statement with that schema, soauth generatewrites a schema-qualified migration that creates the schema before its tables instead of relying on the connection'ssearch_path.#11290
dae97edThanks @bytaesu! - Restore database option type inference for projects that do not use Cloudflare Workers.v1.7.4Compare Source
Patch Changes
#11210
3ff842aThanks @bytaesu! - Prevent bundlers such as Metro from failing when the optional OpenTelemetry API is not installed.#11224
c1756a2Thanks @bytaesu! - Addexperimental.instrumentation.enabledto disable Better Auth OpenTelemetry span creation per auth instance. Instrumentation remains enabled by default and independent of usage reporting.v1.7.3Compare Source
Patch Changes
#11179
352d012Thanks @bytaesu! - Validate Drizzle schema objects and generated Prisma client models during initialization, including in production, and report mismatches with guidance for fixing them. These checks do not query the database and cannot detect unapplied migrations.For Prisma clients whose model metadata omits nullability,
auth generatereports required fields that Better Auth never writes by reading the existing Prisma schema. Setadvanced.database.validateSchema: falseto disable runtime validation.#9908
76d311fThanks @harshil1712! - Add Cloudflare as a built-in social provider, with support for client-secret authentication and PKCE clients without a secret.#11101
3e9e197Thanks @bytaesu! - Add a custom token endpoint authentication strategy for providers that require non-standard request parameters.#11068
157ec8dThanks @bytaesu! - Improve request IP validation performance.#11102
baa08f4Thanks @bytaesu! - Fix TikTok sign-in and token refresh failing when configured with the documentedclientKeyandclientSecretoptions.#11129
9e36635Thanks @bytaesu! - Improve PayPal authorization code and refresh token requests, including PKCE parameter handling.#11178
be0e007Thanks @bytaesu! - Report missing tables, missing columns, and required columns Better Auth never writes during initialization, with guidance for fixing them. Kysely checks the live database schema. Authentication requests await the same check and are rejected if the schema does not match.Validation is enabled by default, including in production. Set
advanced.database.validateSchema: falseto disable runtime validation.auth migraterefuses to apply changes when required unwritten columns need manual repair.#11134
a2bae0cThanks @bytaesu! - Improve Reddit token requests with OAuth-compliant Basic authentication and redirect protection.#11189
1a1b7d5Thanks @bytaesu! - MakeconsumeOneandincrementOneoptional again for custom database adapters, using guarded fallbacks when native methods are absent. Fallbacks require atomic conditional writes and accurate affected-row counts. Fallback increments can fail when contention exhausts their retries.#11153
2220ee7Thanks @bytaesu! - Restore sign-in compatibility with 1.6 databases by identifying accounts with(providerId, accountId)and removing theissuerrequirement introduced in 1.7.0. Upgrading from 1.6 no longer requires an account schema migration. Ambiguous account keys are rejected instead of selecting an arbitrary account.If you applied the 1.7.0 through 1.7.2 account schema, remove its issuer unique index before upgrading. For SQL databases, also make
issuernullable or remove the column so sign-ups and account linking can succeed.auth migratedoes not perform this cleanup. Follow the upgrade guide for database-specific steps.v1.7.2Compare Source
Patch Changes
#12572
69e14d8Thanks @gustavovalverde! - Authorization URLs now keep the authorization endpoint's existing query text unchanged. Before, building the URL re-encoded parameters already on the endpoint, for example%20became+, which broke providers that expect the exact query they published. A parameter that Better Auth sets still replaces an endpoint parameter with the same name.#12586
2a8750bThanks @gustavovalverde! - The default in-memory DPoP replay store used byverifyAccessTokenRequestno longer slows down as traffic grows. Before, each DPoP request scanned every proof recorded in the replay window, so CPU time per request grew with the request rate.#12587
75c0821Thanks @gustavovalverde! - DPoP now works on deployments that keep verification values only in secondary storage. Before, every request with a DPoP proof to the OAuth provider, UserInfo, orrequireMcpAuthfailed with a 500 error unlessverification.storeInDatabase: truewas set. Used proofs are now recorded in secondary storage, so a replayed proof is still rejected across instances.createDpopReplayStorenow also accepts the auth context, ascreateDpopReplayStore(await auth.$context), and picks the same storage.better-auth/better-auth (@better-auth/passkey)
v1.7.23Compare Source
v1.7.22Compare Source
v1.7.21Compare Source
Patch Changes
#12388
070d101Thanks @gustavovalverde! - If a wildcard inbaseURL.allowedHostscovers your passkeyrpID, such asrpID: "example.com"withallowedHosts: ["*.example.com"], your server now starts without a passkeyorigin. Since 1.7.16 it threw at startup unlessoriginwas set, and passkeys then worked only on the origins listed there, so tenants added at runtime needed a redeploy.In that setup, without
origin, a passkey is accepted only from an exactallowedHostsentry, thefallbackorigin, or an origin listed exactly intrustedOrigins. The host the request names and wildcard entries do not count. To allow tenants added at runtime, return their origins from atrustedOriginsfunction that checks your tenant records. If you setorigin, or no wildcard covers yourrpID, nothing changes.v1.7.20Compare Source
v1.7.19Compare Source
v1.7.18Compare Source
v1.7.17Compare Source
Patch Changes
3ab3dbfThanks @bytaesu! - Passkey registration and sign-in now work when onepasskey()plugin is shared between auth instances where some setbaseURLand others do not. Previously one of the instances could fail withORIGIN_NOT_CONFIGUREDor verify against the other instance's origin settings.v1.7.16Compare Source
Patch Changes
f25081aThanks @bytaesu! - Passkey registration, device authorization, two-factor enrollment and verification, social account linking, and phone number changes now reject a session reConfiguration
📅 Schedule: (in timezone Europe/Paris)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.