Compare commits

...

2 Commits

Author SHA1 Message Date
josh eca244f9d4 Merge pull request 'Fix double /api prefix causing invite gate bypass and broken API calls' (#8) from feature/auth-invites into main
CI / build-and-push (push) Successful in 37s
Reviewed-on: #8
2026-04-27 20:47:40 -04:00
josh fbedcec4f2 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>
2026-04-27 20:45:13 -04:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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/apps/web/node_modules ./apps/web/node_modules
COPY . .
ARG VITE_API_URL=/api
ARG VITE_API_URL=
ENV VITE_API_URL=$VITE_API_URL
RUN pnpm --filter @ai-tycoon/shared build && \
pnpm --filter @ai-tycoon/game-engine build && \
+1 -1
View File
@@ -112,7 +112,7 @@ export function validateStoredToken(): void {
}
export const api = {
health: () => request<{ status: string }>('/health', { timeoutMs: 5_000 }),
health: () => request<{ status: string }>('/api/health', { timeoutMs: 5_000 }),
auth: {
anonymous: () => request<{ userId: string; token: string }>('/api/auth/anonymous', { method: 'POST' }),
login: (login: string, password: string) =>