Files
better-auth/packages
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
..
2026-05-09 19:28:11 +00:00
2026-05-31 00:10:16 +01:00
2026-05-31 00:10:16 +01:00
2026-05-31 00:10:16 +01:00
2026-05-29 22:28:58 +01:00
2026-05-31 00:10:16 +01:00
2026-05-31 00:10:16 +01:00
2026-05-29 22:28:58 +01:00
2026-05-29 22:28:58 +01:00