msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
21 stars 13 forks source link

Electron client fails to work when connecting by ip #1676

Closed andreievg closed 1 year ago

andreievg commented 1 year ago

What went wrong? 😲

On a built version of remote server, when connecting by IP (not loopback) electron client fails to connect (can still see login page, but API has 400 error and fonts are not styled.

This is CORS related, if current ip is added to configurations and remote server is restarted this works, so it's CORS related. Although we should allow same origin ¯_(ツ)_/¯

Expected behaviour 🤔

Same origin should be allowed

How to Reproduce 🔨

Get client and demo mac build from: https://github.com/openmsupply/open-msupply/releases/v1.1.11.

Start demo mac build, start client, try to connect to the server with client (make sure it's ip address not localhost or 127.0..), you will se font is not styled and in inspector API won't be reachable

mark-prins commented 1 year ago

changes already in develop