betterauth/react acting weird and hono cors problem

So I saw another post with hono and react but I still get the CORS problem. Tried everything I saw.
Context: I'm running everything from an ubuntu server on my lan, 192.168.18.163. Backend is on hono port 3000 and frontend with vite and 5173. As both are there, on my code I write localhost because they are on the same location.

I added all cors stuff I saw, proxy redirect from vite, even both ports just to see if that's the problem. And I still get cors problems. but the client seems to be acting weird (?) with the request because I can see the origin with my server ip, but should be localhost? here's the raw request:
OPTIONS /api/auth/sign-in/social undefined
Host: localhost:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Referer: http://192.168.18.163:5173/
Origin: http://192.168.18.163:5173
Sec-GPC: 1
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site


And here u can see that I (should) have correctly added cors management (added both ports just in case idk), one screenshot is from server and the other from client and vite client conf:
wezterm-gui_gxuPrxZphu.png
wezterm-gui_6SWIxhRlgX.png
image.png
Was this page helpful?