You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dev: J5 Connect sign-in callbacks keep their origin through Vite's proxy #1333
In vp run dev, a J5 Connect sign-in callback (a join, Add sign-in, or a pairing sign-in) fails its origin check, so it never finishes through the Vite page.
Why:
Vite proxies /api with changeOrigin: true, because /api isn't in DEV_PROXIED_ORIGIN_PRESERVING_PREFIXES in upstream's packages/shared/src/devProxy.ts.
So the server sees its own port as the Host.
completeSignIn and completeJoin compare the callback's origin with the stored return URL, and refuse with SignInExpiredError or SignInElsewhereError.
Production serves the page and /api from one origin and isn't affected. Testers on #1258 and #1271 work around it by sending the callback straight to the API port with the original Host.
Fix (Eng Lead's call, 2026-11-30): preserve the origin for /api/j5/identity only. This is two lines, not one, because Vite uses the first proxy key that matches:
/api/j5/identity goes ahead of /api in DEV_PROXIED_PATH_PREFIXES;
and into DEV_PROXIED_ORIGIN_PRESERVING_PREFIXES.
Upstream's own /api routes are unchanged. It's an edit to an upstream file, so it needs a FORK case.
When: after wave 1's stack (#1323, #1324, #1329 and #1271's UI) merges, so it doesn't fight over FORK case numbers. Testers keep the workaround until then.
Milestone: J5 Connect (#24). Eng Lead: J5 Connect.
Activity