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-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) - 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/core
Bug 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-provider
Bug 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
Bug Fixes
- Fixed API key plugin
customStoragefailures to be logged and rethrown without the keys and values they were called with (#12969)
For detailed changes, see CHANGELOG
@better-auth/electron
Bug Fixes
- Fixed Electron sign-in transfer to fail with
FAILED_TO_CREATE_VERIFICATIONinstead of returning an authorization code when averification.create.beforehook blocks storing it (#12958)
For detailed changes, see CHANGELOG
@better-auth/passkey
Bug Fixes
- Fixed passkey registration and authentication to fail with
FAILED_TO_CREATE_VERIFICATIONinstead of returning a challenge when averification.create.beforehook blocks storing it (#12958)
For detailed changes, see CHANGELOG
@better-auth/sso
Bug Fixes
- Fixed SSO to fail with
FAILED_TO_CREATE_VERIFICATIONinstead of returning a domain verification token or SAML redirect when averification.create.beforehook blocks storing the record (#12958)
For detailed changes, see CHANGELOG
auth
Bug Fixes
- Fixed
auth generateto give missing Prisma back-relations the same@relationname as their foreign-key side, and to error when it cannot add a valid one (#12954)
For detailed changes, see CHANGELOG
Contributors
Thanks to everyone who contributed to this release:
@bytaesu, @gustavovalverde, @seifsheikhelarab
Full changelog: v1.7.28...v1.7.29