From 1994968d5bcaa72b908b58ac293bf65181a7ec59 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 16 Nov 2025 08:48:14 +0000 Subject: [PATCH] completionId: cgen-a73be5c85a3a49dfb7c31b7701154244 cgen-a73be5c85a3a49dfb7c31b7701154244 --- client/lib/aethex-database-adapter.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index bd784de3..be5feda3 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -1074,13 +1074,13 @@ export const aethexAchievementService = { targetUsername: target?.username, }; - // Use API_BASE or fallback to window.location.origin for local dev - const baseUrl = - API_BASE || (typeof window !== "undefined" ? window.location.origin : ""); + // Always use the current origin for API calls since the API is served from the same origin + // This works for both development (localhost:8080) and production (aethex.dev) + const baseUrl = typeof window !== "undefined" ? window.location.origin : ""; if (!baseUrl) { console.warn( - "[Rewards] Cannot activate - no API base URL available", + "[Rewards] Cannot activate - no origin available", ); return null; }