From 10e9411d36f58a8ff4d324d0966feb4956c63cf9 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Thu, 13 Nov 2025 03:00:27 +0000 Subject: [PATCH] Add API_BASE to AuthContext.tsx cgen-546e43c8f9d0444b9d5ec87e43f89c10 --- client/contexts/AuthContext.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index af0a43ea..8188c3a2 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -11,6 +11,8 @@ import { User, Session } from "@supabase/supabase-js"; import { supabase } from "@/lib/supabase"; import { UserProfile } from "@/lib/database.types"; import { aethexToast } from "@/lib/aethex-toast"; + +const API_BASE = (globalThis as any).import?.meta?.env?.VITE_API_BASE || ""; import { aethexUserService, aethexRoleService, @@ -504,7 +506,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ ) { try { // Check if this email is linked to another account - const response = await fetch("/api/user/resolve-linked-email", { + const response = await fetch(`${API_BASE}/api/user/resolve-linked-email`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email }),