[PR #5313] [MERGED] fix(username): compacity with exactOptionalPropertyTypes #5919

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5313
Author: @himself65
Created: 10/15/2025
Status: Merged
Merged: 10/15/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/14/type-fix


📝 Commits (2)

  • f9def12 fix(username): compacity with exactOptionalPropertyTypes
  • 640bb01 chore: fix

📊 Changes

3 files changed (+29 additions, -10 deletions)

View changed files

e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/src/username.ts (+14 -0)
📝 packages/better-auth/src/plugins/username/index.ts (+4 -2)
📝 packages/core/src/types/init-options.ts (+11 -8)

📄 Description

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

Summary by cubic

Made Better Auth compatible with TypeScript’s exactOptionalPropertyTypes. Updates core hook data types to allow undefined on optional fields, plus small username plugin tweaks and a new e2e fixture.

  • Bug Fixes
    • Replaced Partial with Optional in hook data (User, Session, Account, Verification) to support exactOptionalPropertyTypes.
    • Updated username plugin: adjust error-code export to named export and fix mergeSchema import path.
    • Added e2e smoke test fixture configured with exactOptionalPropertyTypes to validate the change.

🔄 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/5313 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/15/2025 **Status:** ✅ Merged **Merged:** 10/15/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/14/type-fix` --- ### 📝 Commits (2) - [`f9def12`](https://github.com/better-auth/better-auth/commit/f9def1211f01b1613106374534a915f229623f63) fix(username): compacity with `exactOptionalPropertyTypes` - [`640bb01`](https://github.com/better-auth/better-auth/commit/640bb011ed398c88306108cd08579ca5db29a18d) chore: fix ### 📊 Changes **3 files changed** (+29 additions, -10 deletions) <details> <summary>View changed files</summary> ➕ `e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/src/username.ts` (+14 -0) 📝 `packages/better-auth/src/plugins/username/index.ts` (+4 -2) 📝 `packages/core/src/types/init-options.ts` (+11 -8) </details> ### 📄 Description Related: https://github.com/better-auth/better-auth/issues/5218 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Made Better Auth compatible with TypeScript’s exactOptionalPropertyTypes. Updates core hook data types to allow undefined on optional fields, plus small username plugin tweaks and a new e2e fixture. - **Bug Fixes** - Replaced Partial<T> with Optional<T> in hook data (User, Session, Account, Verification) to support exactOptionalPropertyTypes. - Updated username plugin: adjust error-code export to named export and fix mergeSchema import path. - Added e2e smoke test fixture configured with exactOptionalPropertyTypes to validate the change. <!-- 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:41:21 -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#5919