From 8bf8584fa64bee7083725013b405181f3798c87e Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Tue, 9 Dec 2025 02:02:36 +0000 Subject: [PATCH] Fix Discord login and update deployment configuration Correct Discord login flow by falling back to window.location.origin when VITE_API_BASE is not set. Update deployment configuration for autoscale and remove dead reference in Login.tsx. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 364421d0-abed-4b4a-a686-4aa79792a4a3 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/LFvmEVc Replit-Helium-Checkpoint-Created: true --- .replit | 4 ++++ client/contexts/AuthContext.tsx | 2 +- client/pages/Login.tsx | 7 ++----- 3 files changed, 7 insertions(+), 6 deletions(-) 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?"}{" "}