Base URL not working.

I pass the following:
export const authClient = createAuthClient({
baseURL: "http://localhost:6600",
basePath: "/auth",
});
export const authClient = createAuthClient({
baseURL: "http://localhost:6600",
basePath: "/auth",
});
But authClient.useSession() makes a request to the frontend instead of the backend.
9 Replies
daveycodez
daveycodez2mo ago
is http://localhost:6600 your backend?
akinkunmi
akinkunmiOP2mo ago
Yes.
Chandra
Chandra2mo ago
have you checked the network tab?
akinkunmi
akinkunmiOP2mo ago
Yes, I did.
Ping
Ping2mo ago
Try removing your basepath, and just set your baseURL to http://localhost:6600/auth
akinkunmi
akinkunmiOP2mo ago
That's the first thing I did. Didn't work. The problem isn't that it's calling the wrong path, the problem is that it's entirely ignoring the base URL I pass in. I think it might be a bug in the SDK.
Ping
Ping2mo ago
Just tested on my end, everything works normally. Do you have a repo I can check out?
akinkunmi
akinkunmiOP2mo ago
I switched to Next.js when I couldn't get it to work but I'll init a new project with the same stack a did before (Tanstack Router and Elysia). I'll share the repo in a minute. Works in the new repo I created. Thank you for your help.
Ping
Ping2mo ago
Sure no worries

Did you find this page helpful?