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:
parent
c43928eb35
commit
0331ecaa84
1 changed files with 1 additions and 2 deletions
|
|
@ -18,8 +18,7 @@ export default function AdminLogin() {
|
||||||
setError('');
|
setError('');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const apiUrl = process.env['NEXT_PUBLIC_API_URL'] || 'http://localhost:3001/api';
|
const response = await fetch('/api/auth/login', {
|
||||||
const response = await fetch(`${apiUrl}/auth/login`, {
|
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue