[PR #8820] [MERGED] chore: fix type inference for future TS compatibility #25136

Closed
opened 2026-04-15 22:44:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8820
Author: @frankeld
Created: 3/28/2026
Status: Merged
Merged: 3/30/2026
Merged by: @gustavovalverde

Base: mainHead: fix-sso-noinfer


📝 Commits (1)

  • 7f224c9 fix(sso): wrap options type with NoInfer to prevent type collapse

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 packages/sso/src/index.ts (+2 -2)

📄 Description

Apply the same NoInfer<O> fix from #6643 and #6689 to the SSO plugin. Without this, tsgo collapses O to Record<string, any> when sso() is used inside betterAuth({ plugins: [...] }), causing TS7031 errors in callback parameters like provisionUser.


Summary by cubic

Fixes type inference in the SSO plugin by wrapping options with NoInfer<O> to stop TypeScript from collapsing them to Record<string, any> when used in betterAuth({ plugins: [...] }). Prevents TS7031 errors in callbacks like provisionUser and improves future TypeScript compatibility.

Written for commit 7f224c9871. 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/8820 **Author:** [@frankeld](https://github.com/frankeld) **Created:** 3/28/2026 **Status:** ✅ Merged **Merged:** 3/30/2026 **Merged by:** [@gustavovalverde](https://github.com/gustavovalverde) **Base:** `main` ← **Head:** `fix-sso-noinfer` --- ### 📝 Commits (1) - [`7f224c9`](https://github.com/better-auth/better-auth/commit/7f224c98713b690d32ddd77de4f1f8877a560df5) fix(sso): wrap options type with NoInfer to prevent type collapse ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/sso/src/index.ts` (+2 -2) </details> ### 📄 Description Apply the same `NoInfer<O>` fix from #6643 and #6689 to the SSO plugin. Without this, tsgo collapses O to Record<string, any> when sso() is used inside betterAuth({ plugins: [...] }), causing TS7031 errors in callback parameters like provisionUser. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes type inference in the SSO plugin by wrapping `options` with `NoInfer<O>` to stop TypeScript from collapsing them to `Record<string, any>` when used in `betterAuth({ plugins: [...] })`. Prevents TS7031 errors in callbacks like `provisionUser` and improves future TypeScript compatibility. <sup>Written for commit 7f224c98713b690d32ddd77de4f1f8877a560df5. 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-04-15 22:44:11 -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#25136