[PR #6797] [CLOSED] fix: warn when baseURL is not explicitly provided #6890

Closed
opened 2026-03-13 13:15:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6797
Author: @yoshifumi-kondo
Created: 12/16/2025
Status: Closed

Base: canaryHead: fix/warn-missing-baseurl


📝 Commits (1)

  • 96e9f2c fix: warn when baseURL is not explicitly provided

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/context/create-context.ts (+6 -0)

📄 Description

Summary

  • Add a warning log when baseURL is not provided in options
  • Helps developers debug redirect URI issues in production or multi-domain environments

Context

When baseURL is not explicitly set, Better Auth falls back to inferred values from environment variables or request headers. This can cause incorrect redirect URIs, especially in:

  • Production environments
  • Multi-domain setups
  • Proxy configurations

This change adds a clear warning message to help developers identify the issue quickly.

Test plan

  • Verified the warning is logged when baseURL is not provided
  • Verified existing tests pass
  • Verified lint passes

Closes #6780


Summary by cubic

Log a clear warning when baseURL is not provided, instead of silently relying on inferred values. This helps developers diagnose incorrect redirect URIs in production, multi-domain, and proxy setups and encourages setting baseURL explicitly.

Written for commit 96e9f2c4ad. Summary will update automatically 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/6797 **Author:** [@yoshifumi-kondo](https://github.com/yoshifumi-kondo) **Created:** 12/16/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/warn-missing-baseurl` --- ### 📝 Commits (1) - [`96e9f2c`](https://github.com/better-auth/better-auth/commit/96e9f2c4ade674cef3f357519f16fa9c6b0ce91d) fix: warn when baseURL is not explicitly provided ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/context/create-context.ts` (+6 -0) </details> ### 📄 Description ## Summary - Add a warning log when `baseURL` is not provided in options - Helps developers debug redirect URI issues in production or multi-domain environments ## Context When `baseURL` is not explicitly set, Better Auth falls back to inferred values from environment variables or request headers. This can cause incorrect redirect URIs, especially in: - Production environments - Multi-domain setups - Proxy configurations This change adds a clear warning message to help developers identify the issue quickly. ## Test plan - [x] Verified the warning is logged when `baseURL` is not provided - [x] Verified existing tests pass - [x] Verified lint passes Closes #6780 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Log a clear warning when baseURL is not provided, instead of silently relying on inferred values. This helps developers diagnose incorrect redirect URIs in production, multi-domain, and proxy setups and encourages setting baseURL explicitly. <sup>Written for commit 96e9f2c4ade674cef3f357519f16fa9c6b0ce91d. Summary will update automatically 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:15:49 -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#6890