Update API calls to use the identity authority domain

Modify the getApiBase function in SubdomainPassport.tsx to correctly determine the API endpoint based on the hostname, prioritizing VITE_FOUNDATION_URL for aethex.me and aethex.space subdomains.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: cb07c935-e82b-48e9-acb9-8ef33f94c84a
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/saoW2ee
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sirpiglr 2025-12-03 00:48:08 +00:00
parent 8683cbaeab
commit 174bffce15

View file

@ -10,8 +10,14 @@ import FourOhFourPage from "@/pages/404";
import Index from "@/pages/Index";
import type { AethexUserProfile } from "@/lib/aethex-database-adapter";
const getApiBase = () =>
typeof window !== "undefined" ? window.location.origin : "";
const getApiBase = () => {
if (typeof window === "undefined") return "";
const hostname = window.location.hostname;
if (hostname.includes("aethex.me") || hostname.includes("aethex.space")) {
return import.meta.env.VITE_FOUNDATION_URL || "https://aethex.foundation";
}
return window.location.origin;
};
interface CreatorPassportResponse {
type: "creator";