Dynamic Callback URLs when running on Docker/Kubernetes #1169

Closed
opened 2026-03-13 08:26:19 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @andrebrito16 on GitHub (May 6, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Deploy an application on Kubernetes
  2. Create an ingress to this application, with two associated domains
  3. Try to login

This will cause an error redirecting to 127.0.0.0, but If I specify the callback on URL it will not work to the another domain.

Current vs. Expected behavior

Should exist a feature like NextAuth where you can redirect to callback dynamically according to origin of request.

What version of Better Auth are you using?

1.2.7

Provide environment information

- Dockerized app (x86 arch)
- Kubernetes

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

No response

Originally created by @andrebrito16 on GitHub (May 6, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Deploy an application on Kubernetes 2. Create an ingress to this application, with two associated domains 3. Try to login This will cause an error redirecting to 127.0.0.0, but If I specify the callback on URL it will not work to the another domain. ### Current vs. Expected behavior Should exist a feature like NextAuth where you can redirect to callback dynamically according to origin of request. ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash - Dockerized app (x86 arch) - Kubernetes ``` ### 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 _No response_
Author
Owner

@dosubot[bot] commented on GitHub (Aug 5, 2025):

Hi, @andrebrito16. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that Better Auth 1.2.7 redirects login to 127.0.0.0 when deployed on Kubernetes with multiple domains.
  • You requested support for dynamic callback URLs based on the request origin, similar to NextAuth.
  • There has been no further activity or comments on this issue since your initial report.
  • The issue remains unresolved and no workaround or fix has been provided yet.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I do not hear back within 7 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 5, 2025): Hi, @andrebrito16. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that Better Auth 1.2.7 redirects login to 127.0.0.0 when deployed on Kubernetes with multiple domains. - You requested support for dynamic callback URLs based on the request origin, similar to NextAuth. - There has been no further activity or comments on this issue since your initial report. - The issue remains unresolved and no workaround or fix has been provided yet. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I do not hear back within 7 days, I will automatically close this issue. Thank you for your understanding and contribution!
Author
Owner

@Stuart-wdas commented on GitHub (Aug 7, 2025):

Has this been looked at? I am having a similar issue where the call back url works in dev and then in a docker container it breaks?

@Stuart-wdas commented on GitHub (Aug 7, 2025): Has this been looked at? I am having a similar issue where the call back url works in dev and then in a docker container it breaks?
Author
Owner

@frectonz commented on GitHub (Aug 11, 2025):

See https://github.com/better-auth/better-auth/issues/3874

@frectonz commented on GitHub (Aug 11, 2025): See https://github.com/better-auth/better-auth/issues/3874
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1169