Google auth redirecting to the main site instead of the webpage

I have an issue which I am not experiencing on other projects using better-auth

I have http://localhost:8000 set as BASE_URL under process.env.BETTER_AUTH_URL, which is my Express API
where http://localhost:3000 is my Next.js website

import { createAuthClient } from "better-auth/react";

export type ExternalAuthProvider = "google" | "facebook" | "apple";

export const authClient = createAuthClient({
    baseURL: process.env.BETTER_AUTH_URL,
});


But when I run the google sign in, it redirects to https://localhost:3000/api/auth/google instead of my Express backend, any ideas on how to fix this?
Solution
@chunkbanned I tried using this env: BETTER_AUTH_URL=http://localhost:YOUR_PORT, and it worked for me, google redirects to the url in the env
Was this page helpful?