# 2026-04-12 — Fix Vite proxy and add success pages **Timestamp:** 2026-04-12T16:00:00 ## Summary Fixed login/registration failures caused by wrong Vite proxy target inside Docker. Added login and registration success pages. Improved error messages to show actual API responses. ## Root Cause Vite's dev server proxy was targeting `http://localhost:8000`. Inside the Docker network, `localhost` resolves to the frontend container itself (not the backend). The correct target inside Docker is `http://backend:8000` (Docker service name). ## Files Modified - `frontend/vite.config.ts` — proxy target now reads from `process.env.VITE_API_TARGET`, falling back to `http://localhost:8000` for local dev without Docker - `docker-compose.dev.yml` — added `VITE_API_TARGET: http://backend:8000` to frontend environment - `frontend/src/App.tsx` — added `/login-success` and `/register-success` routes - `frontend/src/hooks/useAuth.ts` — redirects to `/login-success` after login - `frontend/src/pages/LoginPage.tsx` — parses real API error from response instead of generic message - `frontend/src/pages/RegisterPage.tsx` — redirects to `/register-success` on success; shows real API validation errors ## Files Added - `frontend/src/pages/LoginSuccessPage.tsx` — placeholder: "Login successful" - `frontend/src/pages/RegisterSuccessPage.tsx` — placeholder: "Registration successful" with link to sign in