[GH-ISSUE #800] Better auth is fetch from localhost:3000 even though the Nextjs url is set (!urgent) #8442

Closed
opened 2026-04-13 03:30:45 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @salmansheri on GitHub (Dec 7, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/800

Describe the bug
Better Auth is fetching from localhost:3000 even though the base URL is set

Expected behavior
Should fetch from provided url

Screenshots
Screenshot_2024-12-07-11-41-24_1366x768

Desktop (please complete the following information):

  • OS: Arch Linux
  • Browser Firefox (132.0.2) both incognito and normal window
Originally created by @salmansheri on GitHub (Dec 7, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/800 **Describe the bug** Better Auth is fetching from localhost:3000 even though the base URL is set **Expected behavior** Should fetch from provided url **Screenshots** ![Screenshot_2024-12-07-11-41-24_1366x768](https://github.com/user-attachments/assets/d6bd6d05-6c6a-4f1e-b5db-22a60df4355e) **Desktop (please complete the following information):** - OS: Arch Linux - Browser Firefox (132.0.2) both incognito and normal window
GiteaMirror added the locked label 2026-04-13 03:30:45 -05:00
Author
Owner

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

check your authClient base url

<!-- gh-comment-id:2524965909 --> @Bekacru commented on GitHub (Dec 7, 2024): check your authClient base url
Author
Owner

@salmansheri commented on GitHub (Dec 8, 2024):

check your authClient base url

Screenshot_2024-12-08-07-20-24_1366x768

I Changed the environment variable in vercel but it is again fetching from localhost:3000 and making CORS Error I tried redeploying but it just never works

Screenshot_2024-12-08-07-21-22_1366x768

<!-- gh-comment-id:2525376499 --> @salmansheri commented on GitHub (Dec 8, 2024): > check your authClient base url ![Screenshot_2024-12-08-07-20-24_1366x768](https://github.com/user-attachments/assets/99e6aedb-1da1-49ea-ab22-04166a2cf084) I Changed the environment variable in vercel but it is again fetching from localhost:3000 and making CORS Error I tried redeploying but it just never works ![Screenshot_2024-12-08-07-21-22_1366x768](https://github.com/user-attachments/assets/75031737-67fc-4a11-ae2f-6bce7836d5ac)
Author
Owner

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

No I was asking for the authClient where you initiating the client

<!-- gh-comment-id:2525424716 --> @Bekacru commented on GitHub (Dec 8, 2024): No I was asking for the authClient where you initiating the client
Author
Owner

@salmansheri commented on GitHub (Dec 8, 2024):

No I was asking for the authClient where you initiating the client

Screenshot_2024-12-08-13-12-03_1366x768

I assume you were asking this one right

<!-- gh-comment-id:2525473236 --> @salmansheri commented on GitHub (Dec 8, 2024): > No I was asking for the authClient where you initiating the client ![Screenshot_2024-12-08-13-12-03_1366x768](https://github.com/user-attachments/assets/c95cec8d-cdff-4093-95b3-27ae555b356d) I assume you were asking this one right
Author
Owner

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

no. where you called createAuthClient make sure to pass the right baseURL

createAuthClient({
 baseURL: //
})
<!-- gh-comment-id:2525478430 --> @Bekacru commented on GitHub (Dec 8, 2024): no. where you called `createAuthClient` make sure to pass the right `baseURL` ```ts createAuthClient({ baseURL: // }) ```
Author
Owner

@salmansheri commented on GitHub (Dec 8, 2024):

no. where you called createAuthClient make sure to pass the right baseURL

createAuthClient({
 baseURL: //
})

Thank you for your help sir I found Thank you very much

<!-- gh-comment-id:2525673425 --> @salmansheri commented on GitHub (Dec 8, 2024): > no. where you called `createAuthClient` make sure to pass the right `baseURL` > > ```ts > createAuthClient({ > baseURL: // > }) > ``` Thank you for your help sir I found Thank you very much
Author
Owner

@salmansheri commented on GitHub (Dec 8, 2024):

no. where you called createAuthClient make sure to pass the right baseURL

createAuthClient({
 baseURL: //
})

Issue solved Thank you

<!-- gh-comment-id:2525673575 --> @salmansheri commented on GitHub (Dec 8, 2024): > no. where you called `createAuthClient` make sure to pass the right `baseURL` > > ```ts > createAuthClient({ > baseURL: // > }) > ``` Issue solved Thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8442