Fix double /api prefix causing invite gate bypass and broken API calls
VITE_API_URL was /api but all API paths already included /api/, resulting in /api/api/config etc. Config call failed silently and defaulted to requireInvite:false. Set VITE_API_URL to empty string so paths like /api/auth/anonymous go through nginx as-is. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ COPY --from=deps /app/packages/shared/node_modules ./packages/shared/node_module
|
|||||||
COPY --from=deps /app/packages/game-engine/node_modules ./packages/game-engine/node_modules
|
COPY --from=deps /app/packages/game-engine/node_modules ./packages/game-engine/node_modules
|
||||||
COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules
|
COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
ARG VITE_API_URL=/api
|
ARG VITE_API_URL=
|
||||||
ENV VITE_API_URL=$VITE_API_URL
|
ENV VITE_API_URL=$VITE_API_URL
|
||||||
RUN pnpm --filter @ai-tycoon/shared build && \
|
RUN pnpm --filter @ai-tycoon/shared build && \
|
||||||
pnpm --filter @ai-tycoon/game-engine build && \
|
pnpm --filter @ai-tycoon/game-engine build && \
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export function validateStoredToken(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const api = {
|
export const api = {
|
||||||
health: () => request<{ status: string }>('/health', { timeoutMs: 5_000 }),
|
health: () => request<{ status: string }>('/api/health', { timeoutMs: 5_000 }),
|
||||||
auth: {
|
auth: {
|
||||||
anonymous: () => request<{ userId: string; token: string }>('/api/auth/anonymous', { method: 'POST' }),
|
anonymous: () => request<{ userId: string; token: string }>('/api/auth/anonymous', { method: 'POST' }),
|
||||||
login: (login: string, password: string) =>
|
login: (login: string, password: string) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user