From 7339d51acf295e04b6b0e12ccee23ec99c028b42 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Thu, 14 May 2026 19:40:59 +0000 Subject: [PATCH] fix: use window.location.origin as fallback for VITE_API_URL Vite bakes VITE_* vars at build time, so hardcoding a URL in .env.production breaks CI E2E which runs on localhost. Now falls back to the browser origin at runtime, which works correctly since nginx reverse-proxies /api to the local API container. Fixes GRO-1280. --- apps/web/src/lib/auth-client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/lib/auth-client.ts b/apps/web/src/lib/auth-client.ts index 6a9939a..7c5db68 100644 --- a/apps/web/src/lib/auth-client.ts +++ b/apps/web/src/lib/auth-client.ts @@ -1,7 +1,7 @@ import { createAuthClient } from "better-auth/react"; export const authClient = createAuthClient({ - baseURL: import.meta.env.VITE_API_URL ?? "", + baseURL: import.meta.env.VITE_API_URL || window.location.origin, }); export const { signIn, signOut, useSession, changePassword } = authClient; \ No newline at end of file