AUTH_URL env has no effect #430

Closed
opened 2026-03-13 07:45:33 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @hyoban on GitHub (Dec 19, 2024).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

use AUTH_URL env for baseURL

Current vs. Expected behavior

It should be as valid as BETTER_AUTH_URL

What version of Better Auth are you using?

1.0.22

Provide environment information

System:
  OS: macOS 15.2
  CPU: (8) arm64 Apple M1 Pro
  Memory: 120.31 MB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 22.11.0 - ~/.n/bin/node
  Yarn: 1.22.19 - ~/.n/bin/yarn
  npm: 10.9.0 - ~/.n/bin/npm
  pnpm: 9.15.0 - ~/.n/bin/pnpm
  Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
Browsers:
  Safari: 18.2

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

In this commit c1b0328005, support for AUTH_URL has been removed, but the documentation has not been modified.

/**
 * Base URL for the better auth. This is typically the
 * root URL where your application server is hosted.
 * If not explicitly set,
 * the system will check the following environment variable:
 *
 * process.env.BETTER_AUTH_URL || process.env.AUTH_URL
 *
 * If not set it will throw an error.
 */
baseURL?: string;

Do you want to modify the documentation or restore support?

I am willing to submit a PR to fix this issue.

Originally created by @hyoban on GitHub (Dec 19, 2024). ### Is this suited for github? - [X] Yes, this is suited for github ### To Reproduce use `AUTH_URL` env for baseURL ### Current vs. Expected behavior It should be as valid as `BETTER_AUTH_URL` ### What version of Better Auth are you using? 1.0.22 ### Provide environment information ```bash System: OS: macOS 15.2 CPU: (8) arm64 Apple M1 Pro Memory: 120.31 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.11.0 - ~/.n/bin/node Yarn: 1.22.19 - ~/.n/bin/yarn npm: 10.9.0 - ~/.n/bin/npm pnpm: 9.15.0 - ~/.n/bin/pnpm Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman Browsers: Safari: 18.2 ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context In this commit https://github.com/better-auth/better-auth/commit/c1b03280050d2dfed3418d40342c86b22511c4f1, support for `AUTH_URL` has been removed, but the documentation has not been modified. ``` /** * Base URL for the better auth. This is typically the * root URL where your application server is hosted. * If not explicitly set, * the system will check the following environment variable: * * process.env.BETTER_AUTH_URL || process.env.AUTH_URL * * If not set it will throw an error. */ baseURL?: string; ``` Do you want to modify the documentation or restore support? I am willing to submit a PR to fix this issue.
GiteaMirror added the bug label 2026-03-13 07:45:33 -05:00
Author
Owner

@Bekacru commented on GitHub (Dec 19, 2024):

Yeah, it should be removed from the docs instead so that we have one way of doing things and avoid creating confusion.

@Bekacru commented on GitHub (Dec 19, 2024): Yeah, it should be removed from the docs instead so that we have one way of doing things and avoid creating confusion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#430