diff --git a/.replit b/.replit index d96c59f0..423fc110 100644 --- a/.replit +++ b/.replit @@ -47,6 +47,10 @@ externalPort = 3003 localPort = 8080 externalPort = 8080 +[[ports]] +localPort = 34145 +externalPort = 4200 + [[ports]] localPort = 38557 externalPort = 3000 diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index 685f3b12..9e3d31f6 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -12,7 +12,7 @@ import { supabase } from "@/lib/supabase"; import { UserProfile } from "@/lib/database.types"; import { aethexToast } from "@/lib/aethex-toast"; -const API_BASE = import.meta.env.VITE_API_BASE || ""; +const API_BASE = import.meta.env.VITE_API_BASE || (typeof window !== 'undefined' ? window.location.origin : ""); import { aethexUserService, aethexRoleService, diff --git a/client/pages/Login.tsx b/client/pages/Login.tsx index df73395c..28f1c7ec 100644 --- a/client/pages/Login.tsx +++ b/client/pages/Login.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from "react"; -const API_BASE = import.meta.env.VITE_API_BASE || ""; +const API_BASE = import.meta.env.VITE_API_BASE || window.location.origin; import { useNavigate, Link, useLocation } from "react-router-dom"; import { aethexUserService } from "@/lib/aethex-database-adapter"; @@ -567,10 +567,7 @@ export default function Login() { ? "Already have an account?" : "Don't have an account?"}{" "}