Zum Inhalt springen

Betterauth Updates & Release Notes

Einträge
67
Quellen
1
Zuletzt aktualisiert

Folge Betterauth, um die Release Notes in deinen Feed zu holen.

Betterauth von Better Auth

v1.8.0-beta.12

[!IMPORTANT] Action required

  • If you use sessions from enableSessionForAPIKeys to generate two-factor backup codes, those requests are now refused.

better-auth

❗ Breaking Changes

  • Changed two-factor backup code generation to require a session still active in the store when a server-side session store is used, even with cookie caching

Bug Fixes

  • Fixed phone number sign-in for unverified numbers to fail with FAILED_TO_CREATE_VERIFICATION when a verification.create.before hook keeps the credential proof from being stored
  • Fixed the ID token nonce endpoint to fail with FAILED_TO_CREATE_VERIFICATION when a verification.create.before hook keeps the nonce from being stored

For detailed changes, see CHANGELOG

@better-auth/oauth-provider

Bug Fixes

  • Fixed pushed authorization requests to fail with server_error when a verification.create.before hook keeps them from being stored, instead of returning an unusable request_uri
  • Fixed device code approval on the consent page failing with a server error on databases that reject null in list columns, such as Prisma with PostgreSQL or MongoDB
  • Fixed OAuth provider token revocations to fail with server_error when a verification.create.before hook keeps them from being recorded (#12976) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.29

[!IMPORTANT] Action required

  • If you have plugins or code that use the result of updateVerificationByIdentifier, handle null, which means a hook blocked the update or the value is gone. (#12975)
  • If you have plugins or code that use the result of createVerificationValue, handle null before reading fields such as identifier. (#12958)

better-auth

Bug Fixes

  • Fixed email OTP and phone number codes resent during a wrong-guess check to no longer be replaced by the old code when verification uses only secondary storage (#12956)
  • Fixed two-factor OTP codes that were resent during a wrong-guess check being rejected in favor of the old code (#12956)
  • Fixed secondary storage failures to be logged and rethrown without the session tokens and cached sessions they were called with (#12969)
  • Fixed email OTP resends with resendStrategy: "reuse" to send a new code instead of repeating one that was already used or removed (#12975) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.28

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) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.8.0-beta.11

[!IMPORTANT] Action required

  • If you use requireMcpAuth without an issuer option and verify tokens against keys fetched from a URL (jwksUrl or the JWT plugin's jwks.remoteUrl), make sure tokens carry the discovery issuer, or pass issuer explicitly. (#12714)
  • If you verify OAuth provider tokens outside Better Auth against a pinned jwt.issuer or base URL, switch to the discovery issuer, and accept both values until JWT access tokens issued before the upgrade expire. (#12714)
  • If you throw from customTokenResponseFields or an extensions[].claims.idToken contributor to refuse tokens, move that check to beforeTokenIssuance. (#12663)
  • If you use CIBA, run npx auth@latest migrate, or npx auth@latest generate and apply the schema with your ORM, before you upgrade to add the new approvedViaConsent column on the cibaRequest model. (#12801)
  • If you have OAuth resources with an empty stored allowedScopes that relied on denying every scope, set disabled: true on each (or give it real scopes) before the first 1.8 process starts, and remove any config allowedScopes: [], which now fails at startup. (#12743) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.27

[!IMPORTANT] Action required

  • If you have no key for jwks.keyPairConfig.alg and your newest key uses another jwks.keyPairConfigs algorithm, your ID tokens, /token JWTs, and cookie-cache JWTs change alg and kid on the next unpinned signature, so update verifiers that hard-code the old algorithm or never refetch the JWKS for an unknown kid. (#12655)
  • If you want to keep rejecting a client_uri on a different origin than the client_id, add "client_uri" to originBoundFields, which now defaults to ["post_logout_redirect_uris"]. (#12822)

better-auth

Bug Fixes

  • Fixed the phone number plugin returning a 500 instead of a 400 from /update-user when the request has no body (#12810)
  • Fixed the username plugin returning a 500 on /sign-up/email and /update-user when the request has no body; it now returns the same 400 as without the plugin (#12810)
  • Fixed /sign-in/anonymous to validate the request origin, returning a 403 for browser requests from origins outside trustedOrigins (#12809) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.26

[!IMPORTANT] Action required

  • If you use a custom JWT plugin adapter.getJwks and reads are expensive, add caching inside your key store, since it is now called on every verification. (#12624)

better-auth

Features

  • Added a getAccountFields option to social providers for storing custom values on the provider account at sign-in (#12734)

Bug Fixes

  • Fixed expired verification values being returned to repeated lookups by deleting them when found (#12626)
  • Fixed two-factor sign-in to reject an expired challenge before sending an OTP or counting a failed attempt (#12626)

For detailed changes, see CHANGELOG

@better-auth/core

Features

  • Added a getAccountFields option to social providers for storing custom values on the provider account at sign-in (#12734)
  • Added ID token sign-in for Kakao, so ID tokens from Kakao's native SDKs can be passed to signIn.social (#12316)

Bug Fixes …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.8.0-beta.10

[!IMPORTANT] Action required

  • If you use a read replica for your verification store, make sure it reads its own writes, because every setup now writes a verification row per revoked grant and a lagging replica can let in-flight requests keep their tokens. (#12581)
  • If you want requireMcpAuth to keep verifying JWT signatures alone instead of checking the provider's records, set jwksUrl. (#12597)
  • If you have a grant extension that passes act to issueTokens, set sub_profile: "service" on client actors, or pairwise clients will see those client IDs as pairwise values. (#12584)
  • If you have a may_act that names a service by sub, add sub_profile: "service" so it keeps its client ID. (#12584)
  • If you return undefined from customAccessTokenClaims or other claim sources to remove a claim set elsewhere, return a value such as null instead, because the lower-priority value now stays. (#12575)
  • If you have a custom clientAuthentication strategy that compares aud with expectedAudience, move it to acceptedAudiences and pass that to consumeClientAssertion. (#12599) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.25

[!IMPORTANT] Action required

  • If you want oauthProviderResourceClient(auth) to keep fetching signing keys over HTTP, set jwksUrl. (#12578)

better-auth

Bug Fixes

  • Fixed endpoint errors dropping Access-Control-Expose-Headers names set earlier by a hook or the endpoint, so cross-origin browser clients keep access to exposed headers (#12603)

For detailed changes, see CHANGELOG

@better-auth/oauth-provider

Bug Fixes

  • Fixed OAuth provider 401 challenges to expose WWW-Authenticate to cross-origin browser clients on every endpoint, including client registration and token endpoint authentication (#12603)
  • Fixed DPoP requests failing with a 500 error on deployments that keep verification values only in secondary storage (#12587)
  • Fixed RP-initiated logout on runtimes that block requests to their own hostname by verifying id_token_hint with in-process signing keys (#12578) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.24

[!IMPORTANT] Action required

  • If you accept DPoP-bound tokens, call enforceDpopBinding from better-auth/oauth2 in your endpoint with the request and a shared replay store. (#12498)

better-auth

Bug Fixes

  • Improved verification lookups to delete expired rows at most once a minute per server instance instead of on every lookup (#12593)

For detailed changes, see CHANGELOG

@better-auth/oauth-provider

Bug Fixes

  • Clarified that requireActiveAccessToken checks only the token and does not enforce DPoP binding (#12498)
  • Fixed plugin hook and endpoint errors turning into generic 500 responses when an app installs more than one copy of better-call (#12503)
  • Fixed official packages to accept any better-call 1.4 patch release from 1.4.5 as a peer, so plugins share one copy (#12502)
  • Fixed OAuth provider discovery to stop advertising endpoint URLs with a double slash when baseURL ends in / (#12598) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.23

[!IMPORTANT] Action required

  • If you want requireMcpAuth to keep fetching signing keys over HTTP, set jwksUrl. (#12501)
  • If your CORS layer sets its own Access-Control-Expose-Headers, include WWW-Authenticate in it. (#12521)
  • If you run createMcpProtectedRequestHandler in a multi-instance or serverless deployment, set dpop.replayStore to a shared store such as createDpopReplayStore(internalAdapter). (#12504)

better-auth

Bug Fixes

  • Fixed getTestInstance sharing one MongoDB database across test files, so parallel tests no longer delete each other's data (#12543)

For detailed changes, see CHANGELOG

@better-auth/mcp

Bug Fixes

  • Improved the dpop.replayStore documentation on createMcpProtectedRequestHandler to explain the in-memory default and when to use a shared store (#12504)
  • Fixed requireMcpAuth to accept tokens when the JWT plugin publishes its keys at jwks.remoteUrl (#12501) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.8.0-beta.9

[!IMPORTANT] Action required

  • If your SAML IdP sends no email attribute and a NameID in another Format or with no Format, send an email attribute or the emailAddress NameID Format, set samlConfig.mapping.email to the attribute it sends, or return the NameID from mapProfileToUser. (#12484)
  • If you use the OAuth provider, run npx auth@latest migrate or npx auth@latest generate before upgrading to add the new optional act column on oauthAccessToken; if you set act via customAccessTokenClaims, an extension claims.accessToken contributor, or a resource's customClaims, it is now stripped, so pass act to issueTokens in custom grants instead. (#12439)
  • If your clientAuthentication strategy returns a DPoP key (jkt), the token type is now DPoP, so make your clients send a DPoP proof with each request to a protected resource. (#12440)
  • If you have a custom OAuthProviderApi implementation, add the verifyDpopProof() and issueDpopNonce() methods. (#12437) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.22

better-auth

Bug Fixes

  • Fixed verification value consumption hanging on Cloudflare Workers when an earlier request for the same identifier ended mid-query (#12451)
  • Fixed module-scope auth instances on Cloudflare Workers logging a schema validation error on every cold start by validating on first use (#12448)
  • Fixed deferSessionRefresh refresh requests failing with a 415 error in Next.js and Nuxt (#12330)
  • Fixed ReferenceError: window is not defined when a client session subscription is cleaned up after a test environment tears down its globals (#12324)
  • Fixed client session refresh listeners piling up on the server during SSR (#12324)
  • Fixed session polling never firing when the runtime's navigator does not report connectivity (#12462)
  • Fixed OAuth sign-up rejected by a user.create.before hook returning false logging a TypeError (#12331)
  • Fixed deleteOrganization clearing the session's active organization when a beforeDeleteOrganization hook rejected the delete (#12334) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.8.0-beta.8

[!IMPORTANT] Action required

  • If you set an Authorization entry in authorizationHeaders or pass authorization in headers to the @better-auth/core/oauth2 token request functions, remove it and set the header from customizeRequest with tokenEndpointAuth method custom, which must also set every credential the provider requires. (#12416)
  • If you use the built-in Kysely adapter, run npx auth@latest migrate; if you use Prisma or Drizzle, run npx auth@latest generate and apply the migration before deploying, to add the expiresAt column to oauthClient. MongoDB needs no migration. (#11802)
  • If you use built-in ID token verification and clients send an opaque (non-JWT) token such as a Facebook Graph access token together with a nonce, stop sending the nonce, because those requests are now rejected. If you use a custom verifyIdToken, compare the nonce to the token's claim yourself. (#11823)
  • If you call /one-tap/callback or auth.api.oneTapCallback yourself, first call POST /one-tap/nonce, pass the returned nonce to google.accounts.id.initialize({ nonce }), and send it as nonce in the callback body. If you set the client's nonce option or a nonce in additionalOptions, remove it. (#11823) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.21

[!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)
  • If you set discoveryHeaders and your discoveryUrl redirects to another origin, set discoveryUrl to the final URL, because discovery now fails on cross-origin redirects. (#12179)
  • If your clients match on the invalid_client_metadata error code for rejected post_logout_redirect_uris, update them to check for invalid_redirect_uri. (#12391)
  • If you throw from sendVerificationEmail to reject a sign-up, use a databaseHooks.user.create.before hook instead, because a thrown error is now logged and the sign-up still succeeds. (#12052) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.20

[!IMPORTANT] Action required

  • If your issuer (baseURL, or jwt.issuer when set) uses http on a non-loopback host behind a TLS-terminating proxy, set baseURL to the public https URL, since discovery and the iss parameter no longer rewrite it to https. (#11904)

@better-auth/oauth-provider

Bug Fixes

  • Fixed POST /oauth2/public-client-prelogin with allowPublicClientPrelogin to return a client only when its client_id matches the signed oauth_query, otherwise responding with 401 invalid_client (#12237)
  • Fixed oauthProviderResourceClient(auth) defaults to accept issued access tokens when baseURL is only an origin, by including the auth path in the default issuer, JWKS, and introspection URLs (#12234)
  • Added an allowInsecureRedirectUri option so OAuth provider deployments served over HTTP on private networks can accept http redirect URIs (#11904)

For detailed changes, see CHANGELOG

@better-auth/prisma-adapter

Bug Fixes …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.19

better-auth

Bug Fixes

  • Fixed /admin/create-user leaving a user without a credential account when creating that account failed, such as a database hook throwing, which made retrying with the same email fail with USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL (#12338)
  • Fixed /admin/create-user leaving a user without a credential account when the password was rejected, such as by the Have I Been Pwned plugin, which made retrying with the same email fail with USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL (#12335)
  • Fixed client actions ignoring the HTTP method passed in second-argument fetch options, and attaching a request body when the method was a lowercase get or HEAD (#12336)
  • Fixed plugin schema overrides (modelName and field names) leaking into other instances of the same plugin in one process (#12319)
  • Fixed /device/token returning invalid_grant instead of invalid_client when validateClient rejects the client_id, matching /device/code and RFC 6749 section 5.2 (#12246) …

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.8.0-beta.6

[!IMPORTANT] Action required

  • If your clients exchange their own DPoP-bound access tokens with oauthTokenExchange(), send a DPoP proof signed by the token's key, or have your clientAuthentication strategy return that key as confirmation. (#12262)
  • If your clients send a standard parameter more than once in form-encoded POST requests to /oauth2/authorize, such as state=a&state=b, change them to send each standard parameter only once. (#12261)

@better-auth/oauth-provider

❗ Breaking Changes

  • Fixed form POST requests to /oauth2/authorize to reject repeated standard parameters with invalid_request, matching GET behavior (#12261)

Features

  • Added DPoP key binding to oauthTokenExchange() so a client exchanging its own DPoP-bound access token must prove the same key (#12262)

For detailed changes, see CHANGELOG

Contributors

Thanks to everyone who contributed to this release:

@gustavovalverde

Full changelog: v1.8.0-beta.5...v1.8.0-beta.6

Originalquelle(öffnet in neuem Tab)Problem melden

Betterauth von Better Auth

v1.7.18

[!IMPORTANT] Action required

  • If you use getTestInstance with testWith: "mysql", run a MySQL server at 127.0.0.1:3306 with the root password set to root_password. (#12244)

better-auth

Bug Fixes

  • Fixed "revoke all sessions" with secondaryStorage and storeSessionInDatabase to also revoke sessions created while the revocation is running, except sessions created by a session.delete.after hook, which stay active (#12259)
  • Fixed getTestInstance from better-auth/test to close its own Postgres connection pool and SQLite database when the test file finishes, while with Vitest's default sequence.hooks: "stack" your afterAll hooks still run first and can keep using the instance (#12250)
  • Fixed getTestInstance with testWith: "mysql" hanging, and added a separate database per instance so several instances can run in one test file (#12244)

For detailed changes, see CHANGELOG

@better-auth/core

Bug Fixes …

Originalquelle(öffnet in neuem Tab)Problem melden