Bump better-auth from 1.7.23 to 1.7.29
Bumps better-auth from 1.7.23 to 1.7.29.
Release notes
Sourced from better-auth's releases.
v1.7.29
[!IMPORTANT] Action required
- If you have plugins or code that use the result of
updateVerificationByIdentifier, handlenull, 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, handlenullbefore reading fields such asidentifier. (#12958)
better-authBug 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)- Fixed email OTP and phone number OTP to stop sending a code when a
verification.update.beforehook blocks it from replacing an earlier code (#12975)- Fixed
update.afterdatabase hooks to skip updates that match no record instead of running withnull(#12975)- Fixed
verification.updatedatabase hooks to run when verification values are kept in secondary storage (#12975)- Fixed email OTP and phone number OTP to stop sending codes that a
verification.create.beforehook kept from being stored (#12958)- Fixed magic link, password reset, account deletion, one-time token, SIWE nonce, and two-factor flows to stop handing out links, codes, or tokens that a
verification.create.beforehook kept from being stored (#12958)- Fixed sign-up failing or storing a wrong value when the request includes an
input: falsefield with a functiondefaultValue(#12959)- Fixed
oneTap({ disableSignUp: true })being ignored so/one-tap/callbackno longer creates new users when sign-up is disabled (#12962)- Fixed organization dynamic role names to be trimmed and to reject empty names or names containing a comma with
INVALID_ROLE_NAME(#12952)- Fixed two-factor enable, disable and enrollment to keep the original session creation time when replacing the session, so
session.freshAgeis respected (#12955)For detailed changes, see
CHANGELOG
@better-auth/coreBug Fixes
- Fixed secondary storage failures to be logged and rethrown without the session tokens and cached sessions they were called with (#12969)
- Changed
InternalAdapter.updateVerificationByIdentifierto be typed as returningPromise<Verification | null>, resolving tonullwhen a hook blocks the update or nothing is stored (#12975)- Changed
InternalAdapter.createVerificationValueto be typed as returningPromise<Verification | null>, matching its existingnullresult when a hook returnsfalse(#12958)- Fixed after-commit hooks to log later failures while still throwing the first when multiple hooks fail and no
onAfterCommitHookErrorhandler is set (#12953)- Fixed after-commit hooks failing with
TypeError: hook is not a functionwhen an app loads more than one copy of@better-auth/core(#12953)- Fixed database errors with a non-unique driver code to no longer be mistaken for unique violations because of their message text (#12957)
For detailed changes, see
CHANGELOG
@better-auth/oauth-providerBug Fixes
- Fixed the OAuth provider authorization endpoint to redirect with
error=server_errorinstead of an unusable code when averification.create.beforehook blocks storing it (#12958)- Fixed OAuth provider resource admin endpoints returning a 500 with the Drizzle adapter when a resource or client-resource link already exists (#12951)
For detailed changes, see
CHANGELOG
@better-auth/api-key
... (truncated)
Changelog
Sourced from better-auth's changelog.
1.7.29
Patch Changes
#12959
017a985Thanks@bytaesu! - Sign-up no longer fails, or stores a wrong value, when the request includes aninput: falsefield whosedefaultValueis a function.#12962
59da7fbThanks@bytaesu! -oneTap({ disableSignUp: true })was ignored and/one-tap/callbackstill created new users. It now closes sign-up, anddisableSignupstays as a deprecated alias.#12952
b87f41fThanks@bytaesu! - Organization dynamic role names are now trimmed when created or renamed, and names that are empty or contain a comma are rejected withINVALID_ROLE_NAME.#12956
61bfa16Thanks@gustavovalverde! - Email OTP and phone number codes resent while a wrong guess was being checked are no longer replaced by the old code when verification lives only in secondary storage.#12975
fcd3cbfThanks@gustavovalverde! - WithresendStrategy: "reuse", an email OTP resend no longer repeats a code that was used or removed before the resend could extend its expiry. It sends a new code instead.#12958
bde96d1Thanks@gustavovalverde! - Email OTP and phone number OTP no longer send a code when averification.create.beforedatabase hook returnsfalse. Before, the code was sent even though it was never stored, so every attempt to use it failed withINVALID_OTP.
- Sign-in codes, phone verification codes, and the server-only
createVerificationOTPnow fail withFAILED_TO_CREATE_VERIFICATION(HTTP 500).- Endpoints whose reply hides whether an account exists send nothing and return their usual reply. This covers password reset, email verification, change email, and sign-in codes when
disableSignUpis set.- With
sendVerificationOnSignUp, sign-up still succeeds without sending a code, and the error is logged. The user can request a new code later.#12975
fcd3cbfThanks@gustavovalverde! - Email OTP and phone number OTP no longer send a code when averification.update.beforedatabase hook blocks it from replacing an earlier code. Before, a send that overlapped an earlier one could deliver a code that was never stored, so it always failed withINVALID_OTP. The send now fails withFAILED_TO_CREATE_VERIFICATION, or returns the usual reply on endpoints that hide whether an account exists.#12969
a55ade9Thanks@gustavovalverde! - When secondary storage fails, Better Auth logs and rethrows the error without the keys and values it was called with, so session tokens and cached sessions no longer reach application logs. The error keeps its name, message, and properties, such as the Redis command name, except where they contain one of those keys or values.#12956
61bfa16Thanks@gustavovalverde! - Two-factor OTP codes resent while a wrong guess was being checked are no longer rejected in favor of the old code.#12955
6b883acThanks@bytaesu! - Two-factor enable, disable and enrollment now keep the original sign-in time when they replace the session, even after a password check, so the replacement is only as fresh as the session it replaces forsession.freshAge.#12975
fcd3cbfThanks@gustavovalverde! -update.afterdatabase hooks no longer run when an update matches no record. Before, they ran withnull, although their type promises the updated record, so hooks that read a field, such as the Stripe plugin's user hook, could throw.#12975
fcd3cbfThanks@gustavovalverde! -verification.updatedatabase hooks now run when verification values are kept in secondary storage, asverification.createhooks already did. Withverification.storeInDatabase, secondary storage now changes only after the database update succeeds, so an update that a hook blocks or that finds no row leaves both stores with the same value.#12958
bde96d1Thanks@gustavovalverde! - Magic link, password reset, account deletion, one-time token, SIWE nonce, two-factor OTP, and two-factor sign-in no longer hand out a link, code, token, or challenge when averification.create.beforedatabase hook returnsfalse. Before, they sent something that could never be verified. Most of these endpoints now fail withFAILED_TO_CREATE_VERIFICATION(HTTP 500). Password reset sends no email and returns its usual reply, so it still does not reveal whether the account exists. Sign-in still succeeds when the hook vetoes an optional record: a trusted device is not trusted, and theset-ottheader is left out.Updated dependencies [
55513e8,55513e8,23adcb1,bde96d1,a55ade9,fcd3cbf]:1.7.28
Patch Changes
#12806
47a77c0Thanks@bytaesu! - Revoked sessions are now removed from secondary storage even when a databaseafterhook throws during password reset or user deletion. Before, they could stay valid until they expired.#12858
7e229f0Thanks@bytaesu! - Deleting a user no longer reports success when a database read fails, auser.delete.beforehook vetoes the delete, or the database skips it without an error. A failed read now surfaces as an error. A veto or a skipped delete answersFAILED_TO_DELETE_USERand keeps the user's sessions and accounts, on databases with transactions for a skipped delete.user.delete.beforenow runs before the session and account deletes.
... (truncated)
Commits
1e479e3chore: release v1.7.29 (#12961)fcd3cbffix: refuse OTP sends when a hook blocks the replacement (#12975)a55ade9fix: keep session tokens out of logged storage errors (#12969)bde96d1fix: refuse to hand out codes a verification hook kept from being stored (#12...61bfa16fix: keep a resent OTP when a wrong guess is written back (#12956)1e05684fix(oauth-provider): detect wrapped unique violations on resources (#12951)6b883acfix(two-factor): keep the session creation time when replacing the session (#...b87f41ffix(organization): reject dynamic role names that are not a single role (#12952)41136b1refactor: drop non-null assertions in schema map loops (#12963)59da7fbfix(one-tap): accept the documented disableSignUp option (#12962)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Summary by cubic
Updates better-auth from 1.7.23 to 1.7.29 in the catalog and lockfile. The patch release fixes several OTP and verification flows, keeps session tokens out of storage error logs, and makes oneTap({ disableSignUp: true }) work; it also pulls in better-call 1.4.6 and sharp 0.35.6. Code that uses updateVerificationByIdentifier or createVerificationValue must now handle a null result.