[PR #4911] [MERGED] v1.3.18 #22553

Closed
opened 2026-04-15 21:07:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

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


📝 Commits (10+)

📊 Changes

63 files changed (+1935 additions, -840 deletions)

View changed files

📝 docs/content/docs/integrations/tanstack.mdx (+13 -9)
📝 packages/better-auth/package.json (+1 -0)
📝 packages/better-auth/src/api/routes/account.ts (+35 -18)
📝 packages/better-auth/src/api/routes/email-verification.ts (+12 -7)
📝 packages/better-auth/src/api/routes/reset-password.ts (+26 -16)
📝 packages/better-auth/src/api/routes/session.ts (+10 -5)
📝 packages/better-auth/src/api/routes/sign-in.ts (+55 -23)
📝 packages/better-auth/src/api/routes/sign-up.ts (+2 -2)
📝 packages/better-auth/src/api/routes/update-user.ts (+40 -16)
📝 packages/better-auth/src/db/internal-adapter.test.ts (+120 -1)
📝 packages/better-auth/src/db/internal-adapter.ts (+58 -10)
📝 packages/better-auth/src/error/codes.ts (+7 -3)
📝 packages/better-auth/src/plugins/admin/admin.ts (+124 -65)
📝 packages/better-auth/src/plugins/admin/error-codes.ts (+8 -3)
📝 packages/better-auth/src/plugins/api-key/routes/create-api-key.ts (+38 -21)
📝 packages/better-auth/src/plugins/api-key/routes/delete-api-key.ts (+3 -1)
📝 packages/better-auth/src/plugins/api-key/routes/get-api-key.ts (+3 -1)
📝 packages/better-auth/src/plugins/api-key/routes/update-api-key.ts (+48 -18)
📝 packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts (+6 -2)
📝 packages/better-auth/src/plugins/captcha/error-codes.ts (+6 -4)

...and 43 more files

📄 Description

Summary by cubic

Fixes session cache TTL handling and standardizes API schemas and error codes across the project. Also scaffolds the @better-auth/core package to begin core extraction and improve package structure.

  • Bug Fixes

    • Active sessions TTL now matches the furthest session expiry; list is filtered/sorted and cached with the correct TTL.
    • Expanded internal adapter tests to cover secondary storage TTL behavior.
    • Fixed endpoint typo: mcpOAuthAuthorize.
    • Removed an incorrect baseURL error note in types.
  • Refactors

    • Added defineErrorCodes to enforce UPPER_SNAKE_CASE keys; migrated admin, organization, captcha, username, and base error codes. Split USER_ALREADY_EXISTS and USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL.
    • Replaced z.describe with z.meta({ description }) and tightened schemas (e.g., z.email()) across routes and plugins to improve generated OpenAPI/SDK docs.
    • Initialized @better-auth/core (new workspace package) and wired it into better-auth.

🔄 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/4911 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/25/2025 **Status:** ✅ Merged **Merged:** 9/25/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `v1.3.x-latest` ← **Head:** `v1.3.18-staging` --- ### 📝 Commits (10+) - [`beab151`](https://github.com/better-auth/better-auth/commit/beab151830d03948f48ba2740e88dcd81ebe6080) fix: ttl sessions list expiration (#3836) - [`3978617`](https://github.com/better-auth/better-auth/commit/397861781798b8fd943c371b9007c35048d3a1d5) docs: delete incorrectly documented error case for `baseURL` (#4897) - [`7fb3a77`](https://github.com/better-auth/better-auth/commit/7fb3a77ebb3bf081bee2de84273686aec7876a0c) chore: endpoint spelling `Authroize` -> `Authorize` (#4893) - [`0b7cbb7`](https://github.com/better-auth/better-auth/commit/0b7cbb757e58c1a8185dc1d3a02adc42c8b836ea) chore: add type annotation (#4898) - [`b3851e3`](https://github.com/better-auth/better-auth/commit/b3851e3f27a201d99264334cd42099f2b6d1841c) refactor: shorten expires logic with filters and sorts (#4904) - [`0c2aed8`](https://github.com/better-auth/better-auth/commit/0c2aed804a6a3121faaf97dd7757fce6d3bada2e) chore: type check on error code uppercase (#4907) - [`56a480a`](https://github.com/better-auth/better-auth/commit/56a480a5acbe387fa590f352b6f102d82f87f2dc) chore: init `@better-auth/core` package (#4852) - [`67c29f2`](https://github.com/better-auth/better-auth/commit/67c29f2a214dd7043e8874cc607e236773fa0376) Revert "chore: use zod v3 syntax (#4864)" - [`44590a3`](https://github.com/better-auth/better-auth/commit/44590a3804bdf7bf29b7356d1e764927dcf7a019) Revert "chore: use zod v3 syntax (#4860)" - [`58bbf0f`](https://github.com/better-auth/better-auth/commit/58bbf0f6a80be7898d3ad704e80c9e926f2cbafd) Revert "chore: use zod v3 syntax (#4851)" ### 📊 Changes **63 files changed** (+1935 additions, -840 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/integrations/tanstack.mdx` (+13 -9) 📝 `packages/better-auth/package.json` (+1 -0) 📝 `packages/better-auth/src/api/routes/account.ts` (+35 -18) 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+12 -7) 📝 `packages/better-auth/src/api/routes/reset-password.ts` (+26 -16) 📝 `packages/better-auth/src/api/routes/session.ts` (+10 -5) 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+55 -23) 📝 `packages/better-auth/src/api/routes/sign-up.ts` (+2 -2) 📝 `packages/better-auth/src/api/routes/update-user.ts` (+40 -16) 📝 `packages/better-auth/src/db/internal-adapter.test.ts` (+120 -1) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+58 -10) 📝 `packages/better-auth/src/error/codes.ts` (+7 -3) 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+124 -65) 📝 `packages/better-auth/src/plugins/admin/error-codes.ts` (+8 -3) 📝 `packages/better-auth/src/plugins/api-key/routes/create-api-key.ts` (+38 -21) 📝 `packages/better-auth/src/plugins/api-key/routes/delete-api-key.ts` (+3 -1) 📝 `packages/better-auth/src/plugins/api-key/routes/get-api-key.ts` (+3 -1) 📝 `packages/better-auth/src/plugins/api-key/routes/update-api-key.ts` (+48 -18) 📝 `packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts` (+6 -2) 📝 `packages/better-auth/src/plugins/captcha/error-codes.ts` (+6 -4) _...and 43 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes session cache TTL handling and standardizes API schemas and error codes across the project. Also scaffolds the @better-auth/core package to begin core extraction and improve package structure. - **Bug Fixes** - Active sessions TTL now matches the furthest session expiry; list is filtered/sorted and cached with the correct TTL. - Expanded internal adapter tests to cover secondary storage TTL behavior. - Fixed endpoint typo: mcpOAuthAuthorize. - Removed an incorrect baseURL error note in types. - **Refactors** - Added defineErrorCodes to enforce UPPER_SNAKE_CASE keys; migrated admin, organization, captcha, username, and base error codes. Split USER_ALREADY_EXISTS and USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL. - Replaced z.describe with z.meta({ description }) and tightened schemas (e.g., z.email()) across routes and plugins to improve generated OpenAPI/SDK docs. - Initialized @better-auth/core (new workspace package) and wired it into better-auth. <!-- 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-04-15 21:07:42 -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#22553