better-auth
1.7.25 · 14 Nov 2026MIT21M / weekRepositoryHomepagenpmAtom feed
1.7.27 is the newest release of 1.x.
In short
3 removed2 deprecated78 new2 faster193 fixed6 internal
- Removed
Remove deprecated
ssoClientexport from client plugin - Removed
Remove deprecated forgetPassword endpoints
- Removed
organization: Remove
autoCreateOnSignUpoption as it's not implemented yet - Deprecated
Deprecate
options.advanced.generateIdtype - Deprecated
cli: DefaultNow is deprecated in schema for Drizzle with SQLite
Security
Fixes 1 advisory that affected 1.3.34
- LowBetter Auth's multi-session sign-out hook allows forged cookies to revoke arbitrary sessionsGHSA-wmjr-v86c-m9jj · 26 Nov 2025Fixed in 1.4.0
15 advisories affect 1.4.0; 1.7.7 fixes them
- Criticalbetter-auth: OAuth state can be used as a Magic Link to sign in as another userGHSA-965c-763c-88jm · 27 Oct 2026Fixed in 1.7.7
- CriticalBetter Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp pluginsGHSA-pw9m-5jxm-xr6h · 7 Jul 2026Fixed in 1.6.11
- CriticalBetter Auth Has Two-Factor Authentication Bypass via Premature Session Caching (session.cookieCache)GHSA-xg6x-h9c9-2m83 · 3 Apr 2026Fixed in 1.4.9
- Highbetter-auth: Device login approval does not show the requesting client or permissionsGHSA-q84f-53jg-9ppm · 27 Oct 2026Fixed in 1.7.0
- HighBetter Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-inGHSA-qq9h-g4jm-xgf3 · 24 Jul 2026Fixed in 1.6.22
10 more
- High@better-auth/oauth-provider's OAuth authorization-code grant allows concurrent redemption when two token requests race the find-then-delete primitiveGHSA-7w99-5wm4-3g79 · 7 Jul 2026Fixed in 1.6.11
- HighBetter Auth has insecure cryptographic defaults in oidcProvider: alg=none advertised and plain PKCE accepted by defaultGHSA-9h47-pqcx-hjr4 · 7 Jul 2026Fixed in 1.6.11
- HighBetter Auth has stored XSS in the auth-server origin via javascript: redirect_uri in oidc-provider and mcpGHSA-86j7-9j95-vpqj · 7 Jul 2026Fixed in 1.6.13
- HighBetter Auth has an account takeover issue via OAuth auto-link to unverified pre-registered emailGHSA-g38m-r43w-p2q7 · 7 Jul 2026Fixed in 1.6.11
- HighBetter Auth vulnerable to unauthorized invitation acceptance via unverified email match in organization pluginGHSA-fmh4-wcc4-5jm3 · 7 Jul 2026Fixed in 1.6.11
- HighBetter Auth: Rate limiter keys IPv6 addresses individually and is bypassable via prefix rotationGHSA-p6v2-xcpg-h6xw · 15 May 2026Fixed in 1.4.17
- HighBetter Auth's rou3 Dependency has Double-Slash Path Normalization which can Bypass disabledPaths Config and Rate LimitsGHSA-x732-6j76-qmhm · 16 Dec 2025Fixed in 1.4.5
- HighBetter Auth affected by external request basePath modification DoSGHSA-569q-mpph-wgww · 1 Dec 2025Fixed in 1.4.2
- ModerateBetter Auth: OAuth callback accepts mismatched `state` when cookie-backed state storage is used without PKCEGHSA-wxw3-q3m9-c3jr · 15 May 2026Fixed in 1.6.2
- LowBetter Auth: Stale sessions persist after user deletion across admin, anonymous, and SCIM flowsGHSA-2vg6-77g8-24mp · 7 Jul 2026Fixed in 1.6.11
Release note
Features
Bypass transaction with async local storage
Add
returnHeaderstogetSessionWaku integration guide
Add support for custom callback for authorization url
Additional fields on account
Add support for custom callback for token url
Enum support for drizzle schema
Nextjs 16 guide
Add
storeStateStrategyEnhance PostgreSQL support for non-public schema by respecting
search_pathconfigurationAdd polar oauth provider
Session store chunking
Stateless session management
Esm only
Implement automatic server-side IP detection
Async import in
getAdapterImproved API error page
Add request state
Add support for uuids
Auto-index CLI
Expose additional http methods
better-auth/minimalAdd support for custom response status codes
Support pass raw function as middleware
Support pass raw function as middleware "
Adapter join support
Refactor fetch plugins config disableDefaultFetchPlugins to include userAgentPlugin
Utilize database joins across better-auth
Support storing account data in a cookie
Adding support for SCIM provisioning
Add support for organization slug on list members
anonymous: Support phone number verification for account linking
anonymous: Allow customizing random email generator
captcha: Add support for CaptchaFox
cli: Add mcp client configs from
clicli: Support Cloudflare Workers virtual module imports
client: Refetch session when browser state changes
client: Add type helper
AuthClientclient: Introduce
disableSignalclient optioncore: Replace ZodType with
@standard-schema/specdb: Delete hooks
device-authorization: Add verification uri
discord: Allow specification of permissions
email-otp: Allow returning undefined in
generateOTPexpo: Support multiple cookie prefixes for better-auth detection
generic-oauth: Provide pre configured provider helpers
generic-oauth: Add custom token exchange support for non-standard providers
jwt: Support custom adapter option for jwt
jwt: Add JWT verification endpoint and refactor verification logic
jwt: Add key rotation
last-login-method: Update OAuth login method tracking for multiple auth type
last-login-method: Add support for 'siwe' as a last login method and added tests
mongodb: Support string IDs over ObjectIDs
oauth-proxy: Stateless mode compatibility
oidc-provider: Add RP-Initiated Logout endpoint
organization: Support createdAt on invitations
organization: Refactor organization schema to use BetterAuth types
passkey: Allow multiple passkey origins
paybin: Add Paybin OAuth provider
phone-number: Allow custom verifyOTP implementation
plugin-openapi: Allow passing nonce for CSP
prisma: Enhance JSON default value handling for arrays and objects in schema generation
session: Use JWE for cookie cache by default
sso: DefaultSSO options and ACS endpoint
sso: Provide default service provider metadata
sso: Add option to provide login hint
sso: Add domain verification for SSO providers
stripe: Upgrade stripe support to v19.1.0
stripe: Add
StripePlugintypestripe: Allow any scheme
stripe: Allow flexible types in plan limits
Bug Fixes
Device authorization plugin
Device authorization plugin
Reduce any type in generator.ts
Refresh secondary storage sessions on user update
Allow disable database transaction
Wrap
Math.flooraround the division when calculating TTLTtl sessions list expiration
Tests failing due to clock drift
Refresh secondary storage sessions on user update
Refresh secondary storage sessions on user update
Support compressed ipv6 format
Add required constraint to slug filed in org plugin
Use consistent messaging on
requestPasswordResetCookie size limit shouldn't throw error
Handle symbols in proxy get trap to prevent TypeError
Ttl for rate limited secondary storage
Properly encode callback url for email verificaiton
Session update database hook should expect partial session type
- Deprecated
Deprecate
options.advanced.generateIdtype Api keys should properly check if a request is from client or server
Refactor account deletion functions to trigger database hooks
Improve username transformation logic
Ensure falsy values are valid default values
Import
node:async_hooksdirectlyUndeclared variable reference on docs
Argument
whereof type TwoFactorWhereUniqueInput needs at least one ofidargumentsMobile ai search responsiveness
Type compatibility with
exactOptionalPropertyTypes- Removed
Remove deprecated
ssoClientexport from client plugin GetAcccessToken refresh should properly refresh when oauth tokens are encrypted
Resolve custom URL scheme origin matching with wildcards
Respect additionalFields returned config for user data when setting cookie cache
Correct type
HookEndpointContextandInternalContextAdd optional chaining for process.platform
User-agent requirement when fetching from clients
Unused peer dependency
Rename
shatobranchand made itcanaryby default- Removed
Remove deprecated forgetPassword endpoints
Respect onAPIError.errorURL in OAuth callback flow
Call db hooks when calling
deleteUserAllow user update to handle additional fields and validation
Missing email validation
Urls without protocol shouldn't be able to satisfy a wildcard origin
Use standard validator
Add
undefinedtype for optional property typesType mismatch for 'banned' on UserWithRole
Delete duplicate email existence check in changeEmail endpoint
Add missing userId in listAccounts response
Trigger use session on revoke sessions
stringinference for additionalFieldsUnsanitized endpoints provided dates will cause DB insert failure
Update hooks return should merge with original data
Dont trigger session refresh on magic-link sign-in
Treat generateId "serial" as numeric ID and correct UUID column types across adapters
Validate baseURL protocol and improve error messages
Use
ctxoverrequestin plugin optionsUse
identityinstead ofserialfor pg schemaZoom refresh token
/change-emailshould trigger session signalResolve SESSION_IS_NOT_FRESH error with cookieCache
Preserve provided string IDs in the MongoDB adapter when they are not valid ObjectId
GenericOAuth and SSO ignore discoveryUrl for authorization
Remove active session requirement for change email verification
adapter: Returning null as string for optional id references
adapter: Use updated field values in WHERE clause during update
adapter: Foreign keys that are nullable on number ids can return string of
nulladapter: Ensure transaction function is implemented in the adapter
adapter: Missing data type transformation on where clauses
adapter: Inconsistent mongo
ends_withqueryadapter: Kysely with
CamelCasePluginbreaks for OIDC.adapter: Should not apply
defaultValueduringfindcallsadapter: Drizzle
deleteManyresult should be a numberadapters: Mongodb id issue
admin: Stricter body validation with the setUserPassword api
admin: Validate admin role updates against the configured roles to prevent setting a non-existent role
anonymous: Provide
ctxon accountLinkanonymous:
isAnonymousshould default to false instead of nullapi-key: Cascade api keys on user deletion
api-key: Cascade api keys on user deletion
api-key: Calling client on server side
api-key: Correct refill interval time calculation
api-key: Shouldn't issue api key a mock session by default
api-key: Don't update the
lastRequestwhen calling updateApiKeyapi-key: Remove incorrect usage tracking in updateApiKey
better-auth: Moved email verification check after password check
- Deprecated
cli: DefaultNow is deprecated in schema for Drizzle with SQLite
cli: Timestamp in schema for Drizzle with SQLite
cli: Move type dependencies to devDependencies
client: BaseURL is undefined for SSR
client: Add lynx client exports
client: Missing isRefetching type in react
useSessionclient: Ensure refetchInterval triggers active network request
cookie: SameSite to "none" for oauth state
cookie: SameSite to "none" for oauth state "
core: Correctly set typesVersions paths
create-adapter: Disable transaction by default
custom-session: Don't overwrite the
Set-Cookieheadercustom-session: Infer.Session to infer the return type of the custom session
db:
onDeleteis ignoreddb: Postgres - explicitly define pg_catalog for gen_random_uuid()
device-authorization: Fix client error type for deny device
device-authorization: Sanitize user code input on device approve
drizzle: Replace pgEnum with text enum type in Drizzle schema generation
drizzle-adapter: Handle all operators in multiple
whereconditionsemail-otp: Call reset password callback
email-otp: Email-verification doesn't trigger session signal
email-otp: Fix openapi schema for /email-otp/verify-email endpoint
email-otp: Prevent duplicate verification emails when override is enabled
email-otp: Prevent user enumeration on email OTP
email-otp: Use constant time equal for equality checks
expo: Set-header retrigger
$sessionSignalexpo: Store normalized cookie name in storage
expo: Origin check failing due to null origin in expo
expo: Account linking flow on mobile
expo: Clear peer dependence and flag optional
expo: Enhance cookie detection for better-auth cookies
generic-oauth:
overrideUserInfodoesn't workgeneric-oauth: Await async mapProfileToUser
gitlab: Fix the token endpoint
haveibeenpwned: Check for limited set of paths
last-login-method: Custom resolver method default logic
last-login-method: LastLoginMethod cookie is not set when using a generic oauth provider
last-login-method: Detect passkey login to set last used method
magic-link: Avoid returning error for disabled signup early
magic-link: Ensure emailVerified update is reflected in user object
mcp: Missing Content-Type header for mcp DCR
mcp: Consent requirement should be respected
mongodb: Mongodb findOneAndUpdate should return
.valuemulti-session: Reject cookies without valid signatures on signout hook
nuxt: Avoid load env base url for SSR
oauth: Redirect to GET for POST method
oauth-proxy: Should skip state check for oauth proxy
oauth-proxy: Handle cross-origin flows
oauth-proxy: Return multiple Set-Cookie headers instead of a single comma-separated header
oauth2: Fix user data not reflecting provider updates with overrideUserInfo
odic: Case when
prompt=loginodic: Case when
prompt=login"odic-provider: Default options
oidc: Properly enforce consent requirements per OIDC spec
oidc-provider: OIDC token-type capitalization
oidc-provider: Use consistent iat claim and allow configurable issuer
oidc-provider: Improve typing
oidc-provider:
oidc_login_promptnot cleared after loginoidc-provider: Change updated_at to be a UNIX numeric timestamp
oidc-provider: Fix opts order
oidc-provider:
oidc_login_promptnot cleared after login "oidc-provider: Missing options
oidc-provider: Implement proper OIDC prompt parameter handling
oidc-provider: Redirect to consent when scope changed
openapi: Add
operationIds to routesorg: Use correct adapter during db tranaction
org: Update type to include undefined
organization: Decouple client and server permission checks
organization: Decouple client and server permission checks
organization: Membership check for organizations with large member counts
- Removed
organization: Remove
autoCreateOnSignUpoption as it's not implemented yet organization: Pass
ctxto DB hooksorganization: Allow passing id through
beforeCreateOrganizationorganization: Prevent empty name and slug in create/update
organization: Certain parameters not showing in client types
organization: Prevent duplicate slug on organization update
organization: Compatibility with declaration on tsconfig.json
organization: Compatibility with
exactOptionalPropertyTypesorganization: Typecheck node exceeds the maximum length
organization: Fix the schema type
organization: RemoveTeamMember breaks for prisma
organization: Correct migration order when dynamicAccessControl is enabled
organization: Deleting member from org doesn't delete them from teams
organization: All endpoints should properly infer additional fields
organization: ActiveOrgId no longer inferred after enabling dynamic AC
passkey: Remove
emailfrom querypasskey: Atom listeners not working
passkey: Passkey breaks with
throw: truepasskey: Wrong Session type being used on passkey
passkey: Filter delete passkey with userId
passkey: Ensure addPasskey returns passkey data instead of undefined
phone-number: Shouldn't allow updating phone number on
/update-userendpointsession: Refresh cache before it expires
session: Persist additionalFields in cookie cache
social-providers: Core module import
sso: Safe json parsing for saml/oidc configs
sso: Prevent duplicate SSO provider creation with same providerId
sso: OIDC scopes should fallback to provider scopes
sso: Add deprecated flag to the old
ssoplugin exportsso: Move oauth2-mock-server dep into devDependencies for sso package
sso: Use the internalAdapter for user queries to avoid skipping database hooks
sso: Respect disableImplicitSignUp in SAML callback
sso: Prevent server instance from leaking to client
sso: Export SSOProvider type
stripe: OnCustomerCreate should be called even if update user isn't returned
stripe: Update with an existing subscription
stripe: Sync customer email on db change
stripe:
getCustomerCreateParamsnot actually being calledstripe: Throw error if event failed to be constructed
stripe: Check for reference IDs inside during Stripe reference validation
stripe: Stripe error codes should be returned from the plugin
stripe: Remove TS error suppression updating getCheckoutSessionParams
stripe: Prevent duplicate customer creation on signup
stripe: Return updated subscription in onSubscriptionUpdate callback
stripe: Throw error if query.referenceId is defined
stripe: Cancel subscription fails with Prisma
telemetry: Avoid async import if telemetry disabled, fix for esbuild
telemetry: Avoid async import if telemetry disabled, fix for esbuild "
two-factor: Return parsed array in viewBackupCodes
two-factor: Backup codes shouldn't be encrypted twice
two-factor: Avoid GET endpoints with body
two-factor: Incorrect reference for server only actions
two-factor: Improve error message for bad totp code in 2FA setup
two-factor: Trust device token refresh
two-factor: Use constant time equal for otp comparison
types: Include null in getSession return type
url: Handle empty and root path in withPath, prevent double slashes, add tests
username: Username should respect send on sign config
username: Compacity with
exactOptionalPropertyTypesvk: Check for empty email after user profile mapping
Performance
Improve type
AuthLazy load create telemetry
Lazy load create telemetry "
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.