The axios 401 interceptor used window.location.href = '/login' which bypassed react-router-dom's basename. On a subpath deploy this dumped the user at https://host/login (outside the app) instead of https://host/hp-content-agent/login. Now reads import.meta.env.BASE_URL (set at build time from VITE_BASE_PATH) and prepends it. Also no-ops the redirect when already on a /login route, to avoid the redirect-loop case where GET /auth/me 401s on the login page itself. |
||
|---|---|---|
| .. | ||
| src | ||
| Dockerfile | ||
| index.html | ||
| nginx.conf | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.cjs | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||