Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/modules/auth/utils/auth-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { createAuthClient } from "better-auth/react";
// The baseURL will be automatically determined from the current origin
export const authClient = createAuthClient({
baseURL:
process.env.NODE_ENV === "development"
? "http://localhost:3000"
: typeof window !== "undefined"
? window.location.origin
: "",
typeof window !== "undefined"
? window.location.origin // Auto-detect from browser URL (works for any port)
: process.env.NEXT_PUBLIC_AUTH_URL || "http://localhost:3000", // Fallback for SSR
});