Skip to content

fix: dashboard API calls use same-origin instead of hardcoded localhost ports#1024

Open
web3dev1337 wants to merge 1 commit into
mainfrom
fix/dashboard-same-origin-api
Open

fix: dashboard API calls use same-origin instead of hardcoded localhost ports#1024
web3dev1337 wants to merge 1 commit into
mainfrom
fix/dashboard-same-origin-api

Conversation

@web3dev1337

Copy link
Copy Markdown
Owner

Summary

  • client/dashboard.js hardcoded 2080→localhost:3000 / 2081→localhost:4000 for the recovery-state, windows-startup, and recovery-modal API calls. From any remote browser (phone, second PC) "localhost" is the viewing device, so these calls failed with connection timeouts; locally they were CORS-blocked cross-port anyway.
  • The client dev server already proxies /api (and /socket.io incl. websockets) to the backend, so window.location.origin works identically on the laptop and from any device that can reach the client port.

Test plan

  • Local: dashboard recovery prompt loads without console CORS errors.
  • Remote (second PC via portproxy): dashboard loads with no "check if server is running on port 3000" timeout.
  • node --check client/dashboard.js passes.

🤖 Generated with Claude Code

…st ports

The recovery/startup helpers mapped client port 2080 -> localhost:3000 and
2081 -> localhost:4000, which only resolves on the machine the browser runs
on — from a phone or second PC "localhost" is that device, so the calls
timed out ("please check if server is running on port 3000") and got
CORS-blocked locally too. The client dev server already proxies /api to the
backend, so same-origin works everywhere, remote browsers included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant