Commit 62fe536
authored
fix: resolve demo frontend to real tenant instead of hardcoded dev-tenant (#1245)
* fix: use header-based tenant routing in demo mode
The demo frontend was routing all API calls to non-existent tenant
subdomains (e.g. dev-tenant.demo.meridianhub.cloud), causing 503
errors on every request.
Two changes:
- transport.ts: skip subdomain routing when VITE_DEMO_MODE is set,
use X-Tenant-Slug header instead (same as dev mode)
- App.tsx: DevTenantAutoSelector now queries real tenants from the API
instead of hardcoding a non-existent 'dev-tenant' slug
* fix: revert transport change, backend requires LOCAL_DEV_MODE for header routing
The gateway only reads X-Tenant-Slug when LOCAL_DEV_MODE=true (which
is false on demo). Subdomain routing works correctly since Cloudflare
wildcard DNS and Caddy both handle *.demo.meridianhub.cloud. The sole
issue was the hardcoded non-existent tenant slug in DevTenantAutoSelector.
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent e5ed7c3 commit 62fe536
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
231 | | - | |
| 232 | + | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
239 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
240 | 246 | | |
241 | | - | |
| 247 | + | |
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
| |||
0 commit comments