[PR #6790] [MERGED] chore: use Awaitable type #32486

Closed
opened 2026-04-17 23:17:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6790
Author: @himself65
Created: 12/16/2025
Status: Merged
Merged: 12/16/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/12/16/awaitable


📝 Commits (6)

📊 Changes

28 files changed (+84 additions, -89 deletions)

View changed files

📝 packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts (+2 -2)
📝 packages/better-auth/src/adapters/test-adapter.ts (+2 -4)
📝 packages/better-auth/src/adapters/test.ts (+2 -2)
📝 packages/better-auth/src/api/index.ts (+2 -1)
📝 packages/better-auth/src/client/index.ts (+1 -1)
📝 packages/better-auth/src/plugins/access/types.ts (+1 -1)
📝 packages/better-auth/src/plugins/anonymous/types.ts (+8 -4)
📝 packages/better-auth/src/plugins/api-key/routes/create-api-key.ts (+2 -2)
📝 packages/better-auth/src/plugins/api-key/routes/index.ts (+2 -2)
📝 packages/better-auth/src/plugins/api-key/types.ts (+8 -6)
📝 packages/better-auth/src/plugins/jwt/types.ts (+3 -3)
📝 packages/better-auth/src/plugins/magic-link/index.ts (+3 -2)
📝 packages/better-auth/src/plugins/open-api/index.ts (+1 -2)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/types.ts (+11 -10)
📝 packages/better-auth/src/plugins/phone-number/types.ts (+1 -2)
📝 packages/better-auth/src/plugins/two-factor/otp/index.ts (+2 -2)
📝 packages/better-auth/src/plugins/two-factor/types.ts (+1 -2)
📝 packages/better-auth/src/test-utils/test-instance.ts (+2 -1)
📝 packages/better-auth/src/types/helper.ts (+2 -10)

...and 8 more files

📄 Description

Summary by cubic

Standardized async typing by introducing a shared Awaitable and replacing Promise/union types across the codebase. This clarifies callback signatures, supports both sync and async implementations, and makes types consistent with no runtime changes.

  • Refactors
    • Added Awaitable in core/types/helper.ts and adopted it across adapters, API endpoints, tests, and plugins (anonymous, api-key, jwt, magic-link, organization, two-factor, SSO, expo).
    • Updated DB/storage interfaces, OAuth provider, Prisma adapter $transaction callback, and normalized LiteralString imports and DBPrimitive exports for consistency.

Written for commit 8d46afe5f4. Summary will update automatically on new commits.


🔄 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/6790 **Author:** [@himself65](https://github.com/himself65) **Created:** 12/16/2025 **Status:** ✅ Merged **Merged:** 12/16/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/12/16/awaitable` --- ### 📝 Commits (6) - [`50f44ce`](https://github.com/better-auth/better-auth/commit/50f44ced571e57aa3ccf3d55a82e3ed700b569bb) chore: use `Awaitable` type - [`cc21445`](https://github.com/better-auth/better-auth/commit/cc21445f4ab3c29ba0b9796202ba415a99e21801) chore: fixup - [`2e6f2ea`](https://github.com/better-auth/better-auth/commit/2e6f2ea1bb5d62cdde6ca6180788679ee2cd5cf3) chore: fixup - [`c6e94e9`](https://github.com/better-auth/better-auth/commit/c6e94e925e718c4f8074569627dcff59bd40e8ed) chore: revert - [`ae3df74`](https://github.com/better-auth/better-auth/commit/ae3df74e8750d9d5b09ca63f27a38cda520cfc09) chore: fix imports - [`8d46afe`](https://github.com/better-auth/better-auth/commit/8d46afe5f454fd7858b484c1897deeabaa5a88fc) fix: type ### 📊 Changes **28 files changed** (+84 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts` (+2 -2) 📝 `packages/better-auth/src/adapters/test-adapter.ts` (+2 -4) 📝 `packages/better-auth/src/adapters/test.ts` (+2 -2) 📝 `packages/better-auth/src/api/index.ts` (+2 -1) 📝 `packages/better-auth/src/client/index.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/access/types.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/anonymous/types.ts` (+8 -4) 📝 `packages/better-auth/src/plugins/api-key/routes/create-api-key.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/api-key/routes/index.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/api-key/types.ts` (+8 -6) 📝 `packages/better-auth/src/plugins/jwt/types.ts` (+3 -3) 📝 `packages/better-auth/src/plugins/magic-link/index.ts` (+3 -2) 📝 `packages/better-auth/src/plugins/open-api/index.ts` (+1 -2) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/types.ts` (+11 -10) 📝 `packages/better-auth/src/plugins/phone-number/types.ts` (+1 -2) 📝 `packages/better-auth/src/plugins/two-factor/otp/index.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/two-factor/types.ts` (+1 -2) 📝 `packages/better-auth/src/test-utils/test-instance.ts` (+2 -1) 📝 `packages/better-auth/src/types/helper.ts` (+2 -10) _...and 8 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Standardized async typing by introducing a shared Awaitable<T> and replacing Promise/union types across the codebase. This clarifies callback signatures, supports both sync and async implementations, and makes types consistent with no runtime changes. - **Refactors** - Added Awaitable<T> in core/types/helper.ts and adopted it across adapters, API endpoints, tests, and plugins (anonymous, api-key, jwt, magic-link, organization, two-factor, SSO, expo). - Updated DB/storage interfaces, OAuth provider, Prisma adapter $transaction callback, and normalized LiteralString imports and DBPrimitive exports for consistency. <sup>Written for commit 8d46afe5f454fd7858b484c1897deeabaa5a88fc. Summary will update automatically on new commits.</sup> <!-- 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-17 23:17:15 -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#32486