completionId: cgen-a73be5c85a3a49dfb7c31b7701154244

cgen-a73be5c85a3a49dfb7c31b7701154244
This commit is contained in:
Builder.io 2025-11-16 08:48:14 +00:00
parent 098fe02aa5
commit 1994968d5b

View file

@ -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;
}