[PR #4117] [CLOSED] fix: CLI recognizes default export auth config #22096

Closed
opened 2026-04-15 20:49:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4117
Author: @Kinfe123
Created: 8/21/2025
Status: Closed

Base: canaryHead: fix/cli-default-export


📝 Commits (1)

📊 Changes

2 files changed (+60 additions, -10 deletions)

View changed files

📝 packages/cli/src/utils/get-config.ts (+32 -10)
📝 packages/cli/test/get-config.test.ts (+28 -0)

📄 Description

Summary by cubic

Fixes CLI config loading to recognize default-exported auth instances, so projects exporting auth as default no longer fail to load. Also supports configs exposed directly via options.

  • Bug Fixes
    • getConfig now resolves from auth.options, default export objects (default.options), and top-level options.
    • Applies the same resolution logic for both the main and fallback config paths.
    • Adds a test for default-exported auth configuration.

🔄 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/4117 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 8/21/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/cli-default-export` --- ### 📝 Commits (1) - [`e856222`](https://github.com/better-auth/better-auth/commit/e8562225250fdd02ad0e52458b7366339210540b) lint ### 📊 Changes **2 files changed** (+60 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/cli/src/utils/get-config.ts` (+32 -10) 📝 `packages/cli/test/get-config.test.ts` (+28 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes CLI config loading to recognize default-exported auth instances, so projects exporting auth as default no longer fail to load. Also supports configs exposed directly via options. - **Bug Fixes** - getConfig now resolves from auth.options, default export objects (default.options), and top-level options. - Applies the same resolution logic for both the main and fallback config paths. - Adds a test for default-exported auth configuration. <!-- 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 20:49:00 -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#22096