This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
app/apps/web/src/lib/auth-client.ts
T
Chris Farhood 7339d51acf 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.
2026-05-14 19:40:59 +00:00

7 lines
246 B
TypeScript

import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient({
baseURL: import.meta.env.VITE_API_URL || window.location.origin,
});
export const { signIn, signOut, useSession, changePassword } = authClient;