mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-24 13:45:01 +00:00
The template variable {{NEXT_PUBLIC_API_URL}} in public/env.js was not
being replaced during development, causing the frontend to try to fetch
from the literal string URL:
http://localhost:3000/%7B%7BNEXT_PUBLIC_API_URL%7D%7D/api/auth/login
This resulted in 404 errors and "Login failed" messages.
Solution: Added runtime check to detect unreplaced template variables
and fall back to http://localhost:5000 for development. This preserves
the template for production builds while enabling local development.
Test Results:
✓ 10/12 e2e tests now passing (up from 3/11)
✓ All login flow tests pass (display, error handling, navigation)
✓ All dashboard tests pass (header, logout, refresh)
✓ All terminal modal tests pass (open, close)
✗ 2 minor test failures (UI rendering check, localStorage access)
The core issue (button text "Sign In") is now fully verified and working
in both unit tests and e2e tests.
https://claude.ai/code/session_01T57NPQfoRb2fS7ihdWkTxq