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
This commit is contained in:
TheMaddax 2025-06-25 15:14:27 -05:00
parent c43928eb35
commit 0331ecaa84

View file

@ -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',