[PR #4760] [MERGED] fix(client): baseURL is undefined for SSR #22467

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4760
Author: @himself65
Created: 9/19/2025
Status: Merged
Merged: 9/19/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/18/client-ssr


📝 Commits (1)

  • 61cfcd1 fix(client): baseURL is undefined for SSR

📊 Changes

2 files changed (+27 additions, -1 deletions)

View changed files

packages/better-auth/src/client/client-ssr.test.ts (+25 -0)
📝 packages/better-auth/src/client/config.ts (+2 -1)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4722


Summary by cubic

Fixes SSR clients failing when baseURL is undefined by defaulting to /api/auth. Ensures session requests work on the server.

  • Bug Fixes

    • Default baseURL to "/api/auth" when not provided (SSR-safe).
    • Added Node SSR test to assert getSession calls "/api/auth/get-session".
  • Refactors

    • Removed unused await-object.ts.

🔄 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/4760 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/19/2025 **Status:** ✅ Merged **Merged:** 9/19/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/18/client-ssr` --- ### 📝 Commits (1) - [`61cfcd1`](https://github.com/better-auth/better-auth/commit/61cfcd1a4ae49e177c85771052e428b56580dcf3) fix(client): baseURL is undefined for SSR ### 📊 Changes **2 files changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `packages/better-auth/src/client/client-ssr.test.ts` (+25 -0) 📝 `packages/better-auth/src/client/config.ts` (+2 -1) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4722 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes SSR clients failing when baseURL is undefined by defaulting to /api/auth. Ensures session requests work on the server. - **Bug Fixes** - Default baseURL to "/api/auth" when not provided (SSR-safe). - Added Node SSR test to assert getSession calls "/api/auth/get-session". - **Refactors** - Removed unused await-object.ts. <!-- 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 21:04: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#22467