3620 Commits
Author SHA1 Message Date
Bereket Engida d8683756e2 feat(two-factor): improve two-factor with trust device and state options
- Added trust device functionality allowing users to mark devices as trusted, skipping 2FA on subsequent logins.
- Introduced configuration options for trust device, including cookie name and max age.
- Enhanced two-factor state management with options for storage strategy (cookie, database, or both) and state validity duration.
- Updated documentation to reflect new features and usage examples.
- Removed outdated test file for two-factor plugin.
2025-12-26 18:51:17 -08:00
Dylan VanmaliandGitHub 9c54c108db chore: update import paths (#7003) 2025-12-25 23:19:43 -08:00
b8d5f71b99 feat(stripe): flexible subscription cancellation and termination management (#6961)
Co-authored-by: GautamBytes <manchandanigautam@gmail.com>
2025-12-26 15:01:01 +08:00
TaesuandGitHub 1b329f79e8 fix(expo): improve parseSetCookieHeader (#6990) 2025-12-26 14:45:09 +08:00
Dylan VanmaliandGitHub 243ce021d3 fix(oauth-provider): only session db store currently supported (#7000) 2025-12-25 15:36:22 -08:00
TaesuandGitHub 666d02ed0a fix: add supportsArrays to memory and mongodb adapters (#6984) 2025-12-25 11:07:22 -08:00
c97109ae5a test(oauth-provider): correct failing test (#6996)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-25 11:06:22 -08:00
TaesuandGitHub ef3f3eb564 fix(admin): custom role type inference (#6997) 2025-12-25 11:06:01 -08:00
e8aa51c052 feat: support form data for email sign-in/sign-up and fallback to checking fetch Metadata for first login (#6314)
Co-authored-by: Taesu <166604494+bytaesu@users.noreply.github.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: Jonathan Samines <jn.samines@gmail.com>
2025-12-25 11:05:23 -08:00
Dylan VanmaliandGitHub bf944e05a2 fix(oauth-provider): support jwksPath (#6989) 2025-12-24 11:03:07 -08:00
4f1ec5414e fix: correct accountLinking default to true (#6963)
Co-authored-by: Alex Yang <himself65@outlook.com>
2025-12-25 01:11:06 +08:00
Gautam ManchandaniandGitHub bd5ca7cf6f fix(passkey): use data.id instead of challengeId in deleteVerificationValue (#6826) 2025-12-25 00:03:09 +08:00
Alex YangandGitHub 5a8ff63e8d chore: bump next (#6986) 2025-12-25 00:01:06 +08:00
d5a88df986 fix(anonymous): missing path breaks anonymous hooks (#6794)
Co-authored-by: Alex Yang <himself65@outlook.com>
2025-12-24 22:17:36 +08:00
Alex YangandGitHub ebb889ff84 chore: move @better-auth/utils to catalog (#6981) 2025-12-24 21:38:06 +08:00
Alex Yang 702f624994 chore(sso): allow Buffer (#6979) 2025-12-24 21:20:08 +08:00
Paola Estefanía de CamposandGitHub 7c593ad4d9 feat(saml): add XML parser hardening with configurable size limits (#6805) 2025-12-24 20:27:36 +08:00
TaesuandGitHub 4b0fa1b16c chore: clean up lint warning (#6960) 2025-12-23 22:47:11 -08:00
TaesuandGitHub d16c17adb6 fix(stripe): add 'subscription/restore' to pathMethods (#6959) 2025-12-24 13:32:12 +08:00
KasperandGitHub d8c47707cf chore: BETTER_AUTH_SECRET length check shouldn't throw error (#6954) 2025-12-23 09:00:04 -08:00
Alex Yang 41cb291b8c chore: release v1.5.0-beta.1 2025-12-23 23:56:13 +08:00
Alex YangandGitHub 7d8786cd87 feat: add code property for api error instance (#6633) 2025-12-23 23:55:50 +08:00
Alex YangandGitHub 5471295282 fix(cli): cmd info --json unexpected exit with 1 (#6949) 2025-12-23 18:39:55 +08:00
Paola Estefanía de CamposandGitHub 1f171cb3fd feat(saml): reject deprecated SAML signature and digest algorithms (#6784) 2025-12-23 17:39:24 +08:00
TaesuandGitHub 25445eb022 test(stripe): refactor to use test instance helper (#6683) 2025-12-23 16:50:58 +08:00
TaesuandGitHub ae90b482d0 fix: correct wildcard pattern matching for trustedOrigins (#6904) 2025-12-23 14:08:58 +08:00
Paolo RicciutiandGitHub cd77223b3b fix: don't set state query param if state is not provided (#6822) 2025-12-23 14:00:54 +08:00
KasperandGitHub da820851a7 fix: use operator in list members where clause (#6850) 2025-12-23 14:00:41 +08:00
Nhan NguyenandGitHub 840d0e4b0c fix(cognito): use %20 encoding for scopes instead of + (#6929) 2025-12-23 14:00:15 +08:00
9321632f3d fix(client): set session data on refreshManager (#6932)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-23 14:00:07 +08:00
Alex YangandGitHub dc37a0fe64 chore(sso): remove Buffer usage (#6942) 2025-12-23 13:59:50 +08:00
Paola Estefanía de CamposandGitHub 0e32d9c578 chore(sso): clean up SAML test suite (#6839) 2025-12-23 11:11:10 +08:00
TaesuandGitHub ec38c22938 fix(expo): add missing matcher paths (#6939) 2025-12-23 11:06:53 +08:00
Bereket Engida 9d784407ca chore: release v1.4.8-beta.7 2025-12-22 11:40:01 -08:00
Dylan VanmaliandGitHub 686fba4e11 feat(oauth-provider): an oauth 2.1 compliant plugin (#4163)
An upgrade to oidc-provider plugin that makes it oauth2.1 compliant and has a configuration that is secure by default.

Plans for the deprecation of oidc-provider plugin due to many inherent flaws in its design. Internally, plugin functions now share logic, providing for better future extensibility if new code_grants need to be written or user/client jwt or opaque tokens need to be written. Furthermore, as an oAuth 2.1 provider, it provides logic valid for an MCP server. When using the scope "openid" (optional, enabled by default), the server acts like an OpenId server able to issue id tokens and provides a /userinfo endpoint.

Features

OAuth 2.1 by default
Properly supports authorization_code, refresh_token, and client_credentials grants
PKCE by default (removes plain completely)
Public and confidential client registration
JWT plugin is required by default, but can be disabled using disableJWTPlugin flag
Access tokens can now be received in JWT verifiable format using the resource parameter (ie JWT aud field)
Id tokens are still verifiable by JWKS when using JWT Plugin, or clientSecret if disabled. Fixes issue to prevent public clients when disableJWTPlugin: true from obtaining id tokens directly even when they shouldn't be allowed an id token and should use /userinfo instead.
Protects /userinfo with scope check
Separates Refresh Token and Access token on database schema to allow multiple access tokens per refresh and multiple refresh tokens per login session.
oauthAccessToken strictly deals with opaque tokens
Opaque tokens are given only when resource parameter (aka audience) is not provided
Option to Encode and Decode refresh tokens
allowDynamicClientRegistration with allowUnauthenticatedClientRegistration flags
Separation of default expiration times
Proper creation of public and confidential clients
Prevents misconfiguration between .well-known/openid-configuration endpoint and plugin settings
scopeExpirations to assign scopes specific expiration
Custom claims through separated functions: customAccessTokenClaims, customIdTokenClaims, and customUserInfoClaims
Organizational support through activeOrganizationalId on a session such as through the organizational plugin. Attaches to oAuthClient via reference_id.
Rp-initiated logout
Account Selection via prompt=select_account.
Account Creation via prompt=create.
Prompt combinations prompt=select_account+consent and prompt=login+consent

Docs available at https://www.better-auth.com/docs/plugins/oauth-provider (pr: https://github.com/better-auth/better-auth/blob/main/docs/content/docs/plugins/oauth-provider.mdx)
2025-12-22 11:16:42 -08:00
525f0982ec fix(adapter): apply customTransformInput to where clause values (#6914)
Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
2025-12-22 09:11:19 -08:00
Bereket EngidaandGitHub 52769504e1 chore: improve jsdoc comment for betterAuth instance (#6910) 2025-12-22 18:16:44 +08:00
Alex Yang ed258bc5d6 chore: release v1.4.8-beta.6 2025-12-22 13:40:14 +08:00
TaesuandGitHub 1c9a0f4af6 fix(stripe): update subscriptionId to use Stripe id (#6920) 2025-12-21 18:22:33 +08:00
Bereket Engida 1f8d54488e chore: release v1.4.8-beta.5 2025-12-20 13:28:09 -08:00
d544ba97f9 feat: add a global backgroundTasks config option to defer actions like sending email and updates to run after response is sent (#6713)
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-12-20 11:43:03 -08:00
30dc04b12f docs(organization): update default organization limit to 'unlimited' (#6808)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-20 07:38:11 -08:00
Alex YangandGitHub cbd215f6ac fix: export necessary adapter types (#6903) 2025-12-20 16:33:13 +08:00
FactivenandGitHub fbafa0b9b3 fix(generic-oauth): ensure encryptOAuthTokens is respected in account linking flow (#6874) 2025-12-20 16:16:50 +08:00
MaxwellGitHubcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
3d8eeb9f38 fix: update-user breaking during stateless auth (#6894)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-12-19 22:45:34 -08:00
Paola Estefanía de CamposandGitHub 2f39d862f5 chore: add explicit type for trustedOrigins callback parameter (#6892) 2025-12-19 17:56:46 -08:00
Paola Estefanía de CamposandGitHub 0d0a4edafd test(auth): handle undefined request in trustedOrigins test (#6888) 2025-12-19 15:26:14 -08:00
Bereket Engida 9af0a8b68b chore: support calling trusted origins callback during initalization 2025-12-19 15:03:00 -08:00
Bereket Engida 803459d9bb chore: release v1.4.8-beta.4 2025-12-19 14:52:04 -08:00
Bereket EngidaandGitHub 9469701b5f fix: trusted origins resolving (#6887) 2025-12-19 14:51:16 -08:00