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
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?4 Replies
@chunkbanned In google console change the redirect url

I did
Thats just the URL's that are authorized to be redirected to, it doesnt change anything it only says that the redirect uri is invalid
@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