Commit Graph
6951 Commits
Author SHA1 Message Date
Gustavo Valverde 3fbc2f3405 test(generic-oauth): port regression suites onto the social-provider rewrite (#9799, #9792, #9702, #9578)
next's #9069 rewrote generic-oauth to flow through the core social provider
and callback. The #9799 accessTokenExpiresIn source fix merged in cleanly
(its config field and the applyDefaultAccessTokenExpiry wiring land on the
three token paths); main's regression tests still targeted the old
signIn.oauth2 plugin API. This ports them onto signIn.social so they keep
guarding the behavior:

- #9799: getAccessToken refreshes once the accessTokenExpiresIn window passes
  when the provider omits expires_in, does not refresh when it is unset, and
  applies it to a custom getToken result.
- #9792: the verify-email link preserves the encoded callbackURL.
- #9702: a session hook throwing an APIError redirects to the cross-origin
  errorCallbackURL with the hook's code (proves the rewritten callback's
  hook-error forwarding).
- #9578: implicit-link tests mark the local user verified so linking is
  allowed under the default-on requireLocalEmailVerified gate.

A stale IDP-bounce assertion is updated to next's state-error vocabulary.
All 71 tests pass.

(cherry picked from commit 52adab0db3f463295a0c4e3152d770f4ce40b2d2)
2026-05-31 00:10:36 +01:00
Gustavo Valverde be653ab90d docs(two-factor): merge enforcement-scope clarification into OTP rewrite (#9607)
Layers main's #9607 clarification onto next's #9057 OTP-enablement rewrite.
The "Sign In with 2FA" section now states that 2FA sign-in enforcement
applies to the credential endpoints (/sign-in/email, /sign-in/username,
/sign-in/phone-number) and that passwordless flows are not gated by default,
with guidance to add custom hook handling to require it. The passwordless
callout and the allowPasswordless option note that the flag does not change
which sign-in methods are challenged. main's edit to the removed
skipVerificationOnEnable bullet is dropped, since next deleted that option.

(cherry picked from commit 6156cef51329e1c38544aa06eb5072d8a06ece7a)
2026-05-31 00:10:36 +01:00
Gustavo Valverde 027a10c566 fix(oauth-provider): gate DCR and serve path-prefixed issuer metadata (#9448, #9668)
Re-applies two main fixes onto next's refactored metadata layer.

- #9448: registration_endpoint is now advertised only when dynamic client
  registration is enabled. With DCR off, the field was still advertised in
  authorization-server and OpenID metadata while the endpoint itself was
  disabled, so clients attempted a registration that failed.
- #9668: the authorization-server and OpenID discovery documents are served
  again at their path-prefixed (RFC 8414 path-insertion and issuer-appended)
  aliases via an onRequest handler, with HEAD support and a 405 for
  non-GET/HEAD. next's refactor kept the server-only metadata endpoints but
  dropped the request handler that exposes them over HTTP. The handler is
  adapted to next's metadata (CIMD-aware public-client flag and merged
  discovery metadata) and metadataResponse is exported for it.

#9601 (preserve colons in Basic Auth secret) is already covered: next routes
Basic parsing through @better-auth/core decodeBasicCredentials, which splits
on the first colon, so no change to utils/index.ts.

The merged metadata test suite (union of next and main, including the
DCR-conditional and alias cases) passes.

(cherry picked from commit 66a7b0b62d76e36474ebdca189f59200daa3ec76)
2026-05-31 00:10:36 +01:00
Gustavo Valverde d309e5d2ba fix(oauth): forward hook errors and sync linked profiles on rewritten callback (#9702, #9788, #8758)
Re-applies three main fixes onto next's rewritten OAuth callback, which
now routes generic-oauth through the shared callback route.

- #9702/#9788: a before-callback hook that rejects sign-in (the banned-user
  guard is the flagship case) now redirects to the per-flow errorURL
  carrying the hook's machine-readable code and message, instead of
  surfacing a raw error response. handleOAuthUserInfo is wrapped in
  try/catch; the hook's APIError code is forwarded verbatim (it is
  app-defined, not a member of OAUTH_CALLBACK_ERROR_CODES) via next's
  local redirectOnError closure. The admin plugin's stale inline /callback
  redirect is removed so the banned-user path flows through that single
  forwarder and emits BANNED_USER with a URL-encoded description.
- #8758: accountLinking.updateUserInfoOnLink now applies on the explicit
  OAuth link path, not only id-token linking.

The regression tests (banned social sign-in emits error=BANNED_USER, the
cross-origin errorCallbackURL case, and the 403-JSON id-token case) arrived
via the merge and were red on the baseline; these source changes make them
pass.

(cherry picked from commit 1d893ae572277447025e29462946a7aeb11443ac)
2026-05-31 00:10:35 +01:00
Gustavo Valverde ef4fb0ff95 chore: merge main into next (#9533)
Sync main (through #9821/#9820/#9822/#9768) into next. Conflicting
package.json files keep next's version and intentional divergences (for
example the cli's c12 v4) while taking main's dependency updates, including
the samlify 2.13.1 and fast-xml-parser security bumps; the lockfile is
regenerated from the reconciled set. The 13 source/doc/test conflicts take
next's refactored architecture as the baseline; main's colliding fixes are
re-applied on top in the following per-domain commits.

Clean main fixes land via this merge, including the auto-restored
account-takeover defenses #9578 and #9577.
2026-05-31 00:10:16 +01:00
Gustavo ValverdeandGitHub 4c3bbc4e56 fix(sso): update samlify to 2.13.1 for signed-assertion XML injection (#9821) 2026-05-30 23:58:05 +01:00
Gustavo ValverdeandGitHub 9c8ded67b1 docs(two-factor): mark viewBackupCodes as server-only in its API comment (#9822) 2026-05-30 23:52:38 +01:00
Gustavo ValverdeandGitHub a1028d9f1f fix(deps): force patched transitive versions via pnpm overrides (#9820) 2026-05-30 23:40:38 +01:00
Gustavo ValverdeandGitHub e8696388bf docs(oauth-provider): align metadata routing guidance (#9768) 2026-05-30 22:32:09 +01:00
43c08a2bc7 fix(account): scope OAuth account identity and fix buggy internalAdapter helpers (#9818)
Co-authored-by: Krish Garg <kgarg@chapman.edu>
2026-05-30 20:48:10 +00:00
23d7cbfa79 fix(oauth): apply updateUserInfoOnLink in OAuth callback link flow (#8758)
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2026-05-30 19:48:38 +01:00
Gustavo ValverdeandGitHub e24ddfd13b fix(expo): persist large account cookies by chunking device storage (#9815) 2026-05-30 18:24:14 +01:00
d3919dc1a5 feat(account): support server-side accountInfo calls without session headers (#9813)
Co-authored-by: Nathan Colosimo <nathancolosimo@gmail.com>
2026-05-30 12:45:40 +01:00
5f282bd382 fix(account): default storeStateStrategy to "database" when using secondaryStorage (#9591)
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2026-05-30 11:05:28 +01:00
Gustavo ValverdeandGitHub 5ec3e761a3 fix(ci): use GitHub-hosted runners for fork pull requests (#9809) 2026-05-30 10:24:06 +01:00
TaesuandGitHub e131d3ac5b fix(api-key): verify non-default keys when configId is omitted (#9794) 2026-05-30 03:14:57 +00:00
better-release[bot]andGitHub c0c574ea50 chore: release v1.6.12 (#9590) @better-auth/core@1.6.12 @better-auth/drizzle-adapter@1.6.12 @better-auth/electron@1.6.12 @better-auth/expo@1.6.12 @better-auth/i18n@1.6.12 @better-auth/kysely-adapter@1.6.12 @better-auth/memory-adapter@1.6.12 @better-auth/mongo-adapter@1.6.12 @better-auth/oauth-provider@1.6.12 @better-auth/passkey@1.6.12 @better-auth/prisma-adapter@1.6.12 @better-auth/redis-storage@1.6.12 @better-auth/scim@1.6.12 @better-auth/sso@1.6.12 @better-auth/stripe@1.6.12 @better-auth/telemetry@1.6.12 @better-auth/test-utils@1.6.12 auth@1.6.12 better-auth@1.6.12 @better-auth/api-key@1.6.12 v1.6.12 2026-05-29 22:28:58 +01:00
Gustavo ValverdeandGitHub c5b9f93498 fix(generic-oauth): add accessTokenExpiresIn for providers that omit expires_in (#9799) 2026-05-29 20:49:59 +00:00
17cd433c66 fix(oauth-proxy): missing state-cookie skip for oauth-proxy (#9385)
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2026-05-29 15:06:34 +00:00
Gustavo ValverdeandGitHub c92cd74162 fix: URL-encode callbackURL in verify-email links (#9792) 2026-05-29 08:08:42 +00:00
093115e162 docs(oauth): added Roblox provider and alphabetized "providers without email" table (#9786)
Co-authored-by: Taesu <bytaesu@gmail.com>
2026-05-29 03:16:35 +00:00
TaesuandGitHub 6f3caa390b chore: exclude @better-auth/*, @better-fetch/fetch and better-call from minimumReleaseAge (#9790) 2026-05-28 23:49:50 +00:00
TaesuandGitHub 2b7937fc2f chore: bump @better-auth/utils (#9791) 2026-05-28 23:25:57 +00:00
Gustavo ValverdeandGitHub 0a7cb70647 fix(oauth): honor per-flow errorCallbackURL when state validation fails (#9789) 2026-05-28 23:24:40 +00:00
ac96316af3 fix(oauth): forward specific callback error codes via shared redirectOnError (#9788)
Co-authored-by: Gautam Manchandani <manchandanigautam@gmail.com>
2026-05-28 21:42:16 +00:00
a3b0c63de9 fix: accept hashed nonces for native iOS sign-in with Apple (#8870)
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2026-05-28 12:35:09 +00:00
33a3632731 fix: hotfix passkey handle undefined transports (#9746)
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2026-05-28 01:11:45 +00:00
Jonathan SaminesandGitHub 64dd51c78a docs: add automatic reply to enterprise customer inquiries (#9775) 2026-05-28 00:15:22 +00:00
Jonathan SaminesandGitHub d43281126f docs: add data processing addendum (#9771) 2026-05-27 16:46:53 -06:00
d64174ec86 fix(oauth-provider): hide DCR endpoint unless enabled (#9448)
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2026-05-27 13:18:16 +00:00
8401d11f43 fix(oauth-provider): serve path-prefixed issuer metadata aliases (#9668)
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2026-05-27 12:38:27 +00:00
7bf5449b11 fix(oauth2): map jose token verification errors (#9655)
Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2026-05-27 09:45:02 +00:00
TaesuandGitHub 6711e43f24 docs: align npm and star icons (#9764) 2026-05-27 07:38:03 +00:00
MaxwellandGitHub f6bf45123f fix(api-key): add better-call as peer dependency to fix TS4023 declaration emit (#9759) 2026-05-27 00:05:31 +00:00
MaxwellandGitHub 85ca603eec fix: drizzle mixed and/or (#9756) 2026-05-26 14:08:11 +00:00
8907c7df9c fix(passkey): consume challenge atomically and propagate inner verify errors (#9622)
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
2026-05-24 23:40:52 +00:00
TaesuandGitHub 83fa3695e7 feat(core): add string case conversion utilities (#9727) 2026-05-24 23:40:22 +00:00
TaesuandGitHub 5aa5682e18 chore: adopt AGENTS.md, keep CLAUDE.md as symlink (#9728) 2026-05-24 23:38:36 +00:00
TaesuandGitHub 66dbe8a730 chore(ci): stabilize docker startup (#9587) 2026-05-24 23:05:18 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
168b3ba070 chore(deps): bump turbo from 2.9.4 to 2.9.14 (#9725)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-23 14:34:00 +00:00
TaesuandGitHub a60855e6a0 chore: lock threads silently and document policy (#9724) 2026-05-22 03:40:39 +00:00
TaesuandGitHub 015f96bc63 fix(oauth-proxy): forward result.error verbatim in callback redirect (#9723) 2026-05-22 02:52:48 +00:00
TaesuandGitHub f47aa4aa96 fix(sso): url-encode error query value in OIDC callback redirect (#9722) 2026-05-22 02:52:32 +00:00
TaesuandGitHub 43cc49c640 fix(open-api): emit unique operationIds for multi-method endpoints (#9721) 2026-05-22 01:16:56 +00:00
TaesuandGitHub 23dbe1ad0e fix: redirect hook rejections to errorCallbackURL across auth callback flows (#9702) 2026-05-22 00:14:48 +00:00
5190c2658f fix: fail fast on unsafe MySQL insert returns (#9665)
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2026-05-21 22:14:04 +00:00
5626e1b437 fix: forward session cookie refresh headers (#9667)
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
2026-05-21 20:17:19 +00:00
3f8f310a0f fix(session): preserve real session expiry during stateless cache refresh (#8817)
Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
Co-authored-by: cyphercodes <7407177+cyphercodes@users.noreply.github.com>
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
2026-05-21 20:12:04 +00:00
TaesuandGitHub 4cbc823e69 docs: add active state to products nav tab (#9698) 2026-05-19 23:47:20 +00:00
2d73ffff44 fix(core): respect dynamic baseURL protocol option in getTrustedOrigins (#9644)
Co-authored-by: Taesu <166604494+bytaesu@users.noreply.github.com>
2026-05-19 19:27:09 +00:00