issue with better auth base url configuration
i'm experiencing a problem with better-auth where the login function sends requests to localhost:3000 despite setting
BETTER_AUTH_URL
in the environment. according to the docs, the base url should be configured with BETTER_AUTH_URL, and there's no trailing slash. however, i'm still getting an error that the base url is invalid and the connection is refused. I'm using better auth with elysia and drizzle adapter, I deploy the app on sevalla if anyone is wondering. really appreciate if anyone can help me out with this because I tested and it work normally on my dev environment and even in my local container.

5 Replies
here's the code of my auth and auth client


update
: I've changed baseURL
in auth client to process.env.NEXT_PUBLIC_SITE_URL and now it send the request through with a proper url now but I got not found status from /auth/* instead I suspect it might be an error or I config something wrong in elysia backend
error from sevalla logs:
[better-call]: Make sure the URL has the basePath (/https://seat-reseeee-ftkln.kinsta.app).
here's my elysia auth setup

solved the issue by just set basePath to
/api/auth
