From 0331ecaa845c3ee663110234ee88bc5ef13dafe5 Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Wed, 25 Jun 2025 15:14:27 -0500 Subject: [PATCH] Fix admin login API endpoint: Use Next.js proxy instead of direct backend call - Changed from process.env API_URL to /api/auth/login - Fixes network error by using Next.js API rewrites - Login now properly routes through frontend proxy to backend --- frontend/src/app/admin/page.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/app/admin/page.tsx b/frontend/src/app/admin/page.tsx index 2716f65e..e2d723a2 100644 --- a/frontend/src/app/admin/page.tsx +++ b/frontend/src/app/admin/page.tsx @@ -18,8 +18,7 @@ export default function AdminLogin() { setError(''); try { - const apiUrl = process.env['NEXT_PUBLIC_API_URL'] || 'http://localhost:3001/api'; - const response = await fetch(`${apiUrl}/auth/login`, { + const response = await fetch('/api/auth/login', { method: 'POST', headers: { 'Content-Type': 'application/json',