[PR #7618] [MERGED] chore: simplify type #7444

Closed
opened 2026-03-13 13:36:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7618
Author: @himself65
Created: 1/26/2026
Status: Merged
Merged: 1/26/2026
Merged by: @himself65

Base: canaryHead: himself65/2026/01/26/type-simplify


📝 Commits (1)

📊 Changes

1 file changed (+5 additions, -21 deletions)

View changed files

📝 packages/better-auth/src/types/models.ts (+5 -21)

📄 Description

Summary by cubic

Simplified type helpers by making InferUser and InferSession accept only BetterAuthOptions, removing conditional handling for Auth. This reduces type complexity and makes inference more predictable.

  • Refactors

    • Removed Auth import and union generics in InferUser/InferSession.
    • Types now compose User/Session with Additional*FieldsOutput based solely on options.
  • Migration

    • If you passed Auth to InferUser/InferSession, use auth.options instead.

Written for commit 32163e7dfa. Summary will update 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/7618 **Author:** [@himself65](https://github.com/himself65) **Created:** 1/26/2026 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/01/26/type-simplify` --- ### 📝 Commits (1) - [`32163e7`](https://github.com/better-auth/better-auth/commit/32163e7dfa6d9d81286b7d64b96a3d153eff9a6e) chore: simplify type ### 📊 Changes **1 file changed** (+5 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/types/models.ts` (+5 -21) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Simplified type helpers by making InferUser and InferSession accept only BetterAuthOptions, removing conditional handling for Auth. This reduces type complexity and makes inference more predictable. - **Refactors** - Removed Auth import and union generics in InferUser/InferSession. - Types now compose User/Session with Additional*FieldsOutput based solely on options. - **Migration** - If you passed Auth to InferUser/InferSession, use auth.options instead. <sup>Written for commit 32163e7dfa6d9d81286b7d64b96a3d153eff9a6e. Summary will update 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-03-13 13:36:39 -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#7444