diff --git a/frontend/app/api/auth/google/token/route.ts b/frontend/app/api/auth/google/token/route.ts index 2b54b697..cf8b66c1 100644 --- a/frontend/app/api/auth/google/token/route.ts +++ b/frontend/app/api/auth/google/token/route.ts @@ -4,7 +4,10 @@ */ import { NextRequest, NextResponse } from "next/server"; -const BACKEND_URL = process.env.BACKEND_URL || "http://localhost:8000"; +// Use backend internal URL if available (Railway), fallback to public URL +const BACKEND_URL = process.env.BACKEND_URL || + process.env.NEXT_PUBLIC_API_URL || + "http://localhost:8000"; export async function POST(request: NextRequest) { try {