[PR #4817] [MERGED] v1.3.14 #5592

Closed
opened 2026-03-13 12:28:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4817
Author: @himself65
Created: 9/22/2025
Status: Merged
Merged: 9/22/2025
Merged by: @himself65

Base: v1.3.x-latestHead: v1.3.14-staging


📝 Commits (9)

  • c0e4f95 fix(organization): pass ctx to DB hooks (#4769)
  • 3cb2e57 fix(api-key): calling client on server side (#4777)
  • 4204896 fix(organization): allow passing id through beforeCreateOrganization (#4765)
  • a09629c chore: add lint rule noDebugger (#4778)
  • 5439091 fix: wrap Math.floor around the division when calculating TTL (#4768)
  • 0caa37b fix(mcp): missing Content-Type header for mcp DCR (#4763)
  • da38d2c feat(passkey): allow multiple passkey origins (#4800)
  • 5a1191b fix(username): username should respect send on sign config (#4799)
  • 0882f43 feat(sso): defaultSSO options and ACS endpoint (#3660)

📊 Changes

24 files changed (+1654 additions, -243 deletions)

View changed files

📝 biome.json (+2 -1)
📝 demo/nextjs/lib/auth.ts (+106 -1)
📝 demo/nextjs/package.json (+1 -0)
📝 docs/components/sidebar-content.tsx (+15 -0)
docs/content/docs/guides/saml-sso-with-okta.mdx (+174 -0)
📝 docs/content/docs/plugins/sso.mdx (+108 -45)
e2e/smoke/test/ssr.ts (+76 -0)
📝 packages/better-auth/src/api/to-auth-endpoints.ts (+11 -2)
📝 packages/better-auth/src/db/internal-adapter.test.ts (+150 -0)
📝 packages/better-auth/src/db/internal-adapter.ts (+3 -1)
📝 packages/better-auth/src/plugins/mcp/index.ts (+1 -0)
📝 packages/better-auth/src/plugins/mcp/mcp.test.ts (+3 -0)
📝 packages/better-auth/src/plugins/organization/adapter.ts (+10 -2)
📝 packages/better-auth/src/plugins/organization/routes/crud-invites.ts (+2 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+2 -2)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+7 -3)
📝 packages/better-auth/src/plugins/organization/routes/crud-team.ts (+2 -0)
📝 packages/better-auth/src/plugins/passkey/index.ts (+4 -4)
📝 packages/better-auth/src/plugins/username/index.ts (+31 -4)
packages/sso/CHANGELOG.md (+0 -20)

...and 4 more files

📄 Description

Related: https://github.com/better-auth/better-auth/issues/4757


Summary by cubic

Fixes several auth flows and hook behaviors, improves session cache accuracy, and stabilizes organization session updates. Adds passkey multi-origin support and proper JSON headers; also tightens linting.

  • New Features

    • Passkey: support multiple origins via options.origin (string or string[]).
  • Bug Fixes

    • Hooks: toAuthEndpoints now returns proper responses/headers from before hooks.
    • Sessions: correctly floor TTL seconds when caching in secondary storage (tests included).
    • Organization: pass ctx when setting active org/team; allow ID from beforeCreateOrganization.
    • Username: honor emailVerification.sendOnSignIn; send verification email when configured, otherwise block sign-in.
    • MCP: add Content-Type: application/json for 201 responses.
    • Tooling: enforce noDebugger lint rule; add SSR e2e test for server-side API key client.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4817 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/22/2025 **Status:** ✅ Merged **Merged:** 9/22/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `v1.3.x-latest` ← **Head:** `v1.3.14-staging` --- ### 📝 Commits (9) - [`c0e4f95`](https://github.com/better-auth/better-auth/commit/c0e4f9570b01f499d991c1e6c620a29d345108a4) fix(organization): pass `ctx` to DB hooks (#4769) - [`3cb2e57`](https://github.com/better-auth/better-auth/commit/3cb2e57ca24befa43d943a65c0bda598acb81bf4) fix(api-key): calling client on server side (#4777) - [`4204896`](https://github.com/better-auth/better-auth/commit/42048960c7bdc79c0664adea11e4e88f2e061634) fix(organization): allow passing id through `beforeCreateOrganization` (#4765) - [`a09629c`](https://github.com/better-auth/better-auth/commit/a09629cea15ec5f444b4889b1cf1e3e4c7ad72ed) chore: add lint rule `noDebugger` (#4778) - [`5439091`](https://github.com/better-auth/better-auth/commit/54390917152e48dec345d9919b0b2c680ca8dd79) fix: wrap `Math.floor` around the division when calculating TTL (#4768) - [`0caa37b`](https://github.com/better-auth/better-auth/commit/0caa37be949a44ff3cfe38c6ae3cad10df59be3b) fix(mcp): missing Content-Type header for mcp DCR (#4763) - [`da38d2c`](https://github.com/better-auth/better-auth/commit/da38d2c90ba897506df10e7bcc0785a55b4dc2ee) feat(passkey): allow multiple passkey origins (#4800) - [`5a1191b`](https://github.com/better-auth/better-auth/commit/5a1191bc347218c69984a9828c5bdfaa5abe5b4f) fix(username): username should respect send on sign config (#4799) - [`0882f43`](https://github.com/better-auth/better-auth/commit/0882f43ef072bd66a83d50ee6822fa35a831d178) feat(sso): defaultSSO options and ACS endpoint (#3660) ### 📊 Changes **24 files changed** (+1654 additions, -243 deletions) <details> <summary>View changed files</summary> 📝 `biome.json` (+2 -1) 📝 `demo/nextjs/lib/auth.ts` (+106 -1) 📝 `demo/nextjs/package.json` (+1 -0) 📝 `docs/components/sidebar-content.tsx` (+15 -0) ➕ `docs/content/docs/guides/saml-sso-with-okta.mdx` (+174 -0) 📝 `docs/content/docs/plugins/sso.mdx` (+108 -45) ➕ `e2e/smoke/test/ssr.ts` (+76 -0) 📝 `packages/better-auth/src/api/to-auth-endpoints.ts` (+11 -2) 📝 `packages/better-auth/src/db/internal-adapter.test.ts` (+150 -0) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+3 -1) 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+1 -0) 📝 `packages/better-auth/src/plugins/mcp/mcp.test.ts` (+3 -0) 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+10 -2) 📝 `packages/better-auth/src/plugins/organization/routes/crud-invites.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+7 -3) 📝 `packages/better-auth/src/plugins/organization/routes/crud-team.ts` (+2 -0) 📝 `packages/better-auth/src/plugins/passkey/index.ts` (+4 -4) 📝 `packages/better-auth/src/plugins/username/index.ts` (+31 -4) ➖ `packages/sso/CHANGELOG.md` (+0 -20) _...and 4 more files_ </details> ### 📄 Description Related: https://github.com/better-auth/better-auth/issues/4757 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes several auth flows and hook behaviors, improves session cache accuracy, and stabilizes organization session updates. Adds passkey multi-origin support and proper JSON headers; also tightens linting. - **New Features** - Passkey: support multiple origins via options.origin (string or string[]). - **Bug Fixes** - Hooks: toAuthEndpoints now returns proper responses/headers from before hooks. - Sessions: correctly floor TTL seconds when caching in secondary storage (tests included). - Organization: pass ctx when setting active org/team; allow ID from beforeCreateOrganization. - Username: honor emailVerification.sendOnSignIn; send verification email when configured, otherwise block sign-in. - MCP: add Content-Type: application/json for 201 responses. - Tooling: enforce noDebugger lint rule; add SSR e2e test for server-side API key client. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:28:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5592