f746cb0825
- vite.config.ts: proxy target via VITE_API_TARGET env var (falls back to localhost) - docker-compose.dev.yml: set VITE_API_TARGET=http://backend:8000 - Add /login-success and /register-success placeholder pages - Show real API error messages in login/register forms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
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 fromprocess.env.VITE_API_TARGET, falling back tohttp://localhost:8000for local dev without Dockerdocker-compose.dev.yml— addedVITE_API_TARGET: http://backend:8000to frontend environmentfrontend/src/App.tsx— added/login-successand/register-successroutesfrontend/src/hooks/useAuth.ts— redirects to/login-successafter loginfrontend/src/pages/LoginPage.tsx— parses real API error from response instead of generic messagefrontend/src/pages/RegisterPage.tsx— redirects to/register-successon 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