Better Auth v1.8.0-beta.5

v1.8.0-beta.5Pre-release
Changed 8
  • Credential sign-in after-hooks now run after the built-in two-factor challenge and receive a null new session while verification is pending
  • Passkey authentication now applies authenticatorSelection.userVerification, rejecting responses without user verification when it is set to required
  • Passkey registration now requires a session still active in the store when a server-side session store is used, even with cookie caching
  • Device-code approval now requires a session still active in the store when a server-side session store is used, even with cookie caching
  • Two-factor enrollment, phone number changes, social account linking, and organization invitations now require a session still active in the store when a server-side session store is used, even with cookie caching
  • Phone number verification now requires ownership of the account holding an unverified number, and sign-up and sign-in reject a phoneNumber with PHONE_NUMBER_CANNOT_BE_SET
  • Phone password reset now works only for a number already verified on the account
  • Electron desktop sign-in now completes only after two-factor verification and the other sign-in after-hooks, regardless of plugin order, and requires the issuing browser session until the code is exchanged

From Better Auth

[!IMPORTANT] Action required

  • If you write plugin after-hooks for credential sign-in routes, handle a null new session while two-factor verification is pending. (#12202)
  • If you set authenticatorSelection.userVerification to required, passkey sign-in now rejects responses without user verification. (#12202)
  • If you use phone sign-in with requireVerification, configure sendOTP. Without it the route returns SEND_OTP_NOT_IMPLEMENTED. (#12202)
  • If users reset passwords by phone, they must verify the number first. Otherwise resetPassword returns PHONE_NUMBER_PENDING_VERIFICATION. (#12202)
  • If you use sessions from enableSessionForAPIKeys on passkey registration, device-code approval, two-factor enrollment, phone number changes, social account linking, or organization invitations, those requests are now refused. If you call linkOAuthAccount directly, pass the session that started the link in OAuth state. (#12202)
better-auth
❗ Breaking Changes
  • Changed passkey registration, device-code approval, two-factor enrollment, phone number changes, social account linking, and organization invitations to require a session still active in the store when a server-side session store is used, even with cookie caching (#12202)
  • Changed phone number verification to require ownership of the account that holds an unverified number, and sign-up and sign-in to reject a phoneNumber with PHONE_NUMBER_CANNOT_BE_SET (#12202)
  • Changed phone password reset to work only for a number already verified on the account (#12202)
  • Changed credential sign-in after-hooks to run after the built-in two-factor challenge, so Electron desktop sign-in completes only after two-factor verification (#12202)

For detailed changes, see CHANGELOG

@better-auth/electron
❗ Breaking Changes
  • Changed Electron desktop sign-in to complete only after two-factor verification and the other sign-in after-hooks, regardless of plugin order, and to require the issuing browser session until the code is exchanged (#12202)

For detailed changes, see CHANGELOG

@better-auth/passkey
❗ Breaking Changes
  • Changed authenticatorSelection.userVerification to apply to authentication as well as registration, rejecting responses without user verification when it is required (#12202)
  • Changed passkey registration to require a session still active in the store when a server-side session store is used, even with cookie caching (#12202)

For detailed changes, see CHANGELOG

@better-auth/core
❗ Breaking Changes
  • Changed credential sign-in after-hooks to run after the built-in two-factor challenge and to receive a null new session while verification is pending (#12202)

For detailed changes, see CHANGELOG

@better-auth/oauth-provider
❗ Breaking Changes
  • Changed device-code approval to require a session still active in the store when a server-side session store is used, even with cookie caching (#12202)

For detailed changes, see CHANGELOG

Contributors

Thanks to everyone who contributed to this release:

@gustavovalverde @Bekacru @bytaesu

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

View original

Upgraded? How did it go?

Discussion