bb-plane-fork/apps/web/core/services
binarybeach a9b4921973 binarybeachio: SPA 401 interceptor hard-nav via /sign-in/ + cache-bust
Vanilla 401 handler did `window.location.replace('/?next_path=<currentPath>')`.
That IS a hard nav, but the browser's HTTP cache returns the cached SPA
bundle for `/` — the SPA boots, re-fetches the same /api endpoint, gets 401
again, and loops without ever hitting Traefik at the document level. Diagnosed
2026-05-05 via HAR analysis: 9 history entries bouncing `/` ↔ `/?next_path=/`
at ~780ms intervals; zero requests to bridge or oauth2-proxy during the
loop; first bridge.binarybeach.io/handoff request only after Ctrl+Shift+R.

Trigger on the platform side: oauth2-proxy refresh fails for cross-org
gmail-federated users (separate root cause — disabled platform-wide via
OAUTH2_PROXY_OIDC_GROUPS_CLAIM=). The hard-nav fix here is the safety net
that handles that and any other future 401-causing scenario.

Replace with `window.location.replace('/sign-in/?_bb_reauth=<Date.now()>')`:
- /sign-in/ matches Plane's priority-200 plane-signin-redirect Traefik
  router (matched on PathRegexp `^/(sign-in|sign-up|signin|login|register|
  accounts/sign-in)(/.*)?$$`), which 302s to the bridge handoff regardless
  of cookie state.
- _bb_reauth=<ts> cache-busts so even a previously-cached /sign-in/
  response can't short-circuit the request.

Vanilla Plane regression-safe: /sign-in/ is also a known SPA route in
upstream that bounces to /, so non-platform deployments see the same
behavior they'd get without this patch (modulo a single extra navigation).

Also fixes BINARYBEACHIO.md frontend build instructions: Dockerfile.web
needs the monorepo root as build context (turbo prune scope), opposite of
Dockerfile.api which needs apps/api/ as context.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 14:38:03 -10:00
..
favorite chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
inbox chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
integrations chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
issue binarybeachio: presigned PUT for uploads (R2/B2 don't implement PostObject) 2026-04-30 17:56:52 -10:00
page chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
project chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
ai.service.ts chore: merge constants and services (#8623) 2026-02-10 21:10:54 +05:30
analytics.service.ts fix: remove unused imports and variables (part 2 — web/core non-issues) (#8752) 2026-03-25 02:04:20 +05:30
api.service.ts binarybeachio: SPA 401 interceptor hard-nav via /sign-in/ + cache-bust 2026-05-05 14:38:03 -10:00
app_config.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
app_installation.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
auth.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
cycle.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
cycle_archive.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
dashboard.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
estimate.service.ts chore: merge constants and services (#8623) 2026-02-10 21:10:54 +05:30
file-upload.service.ts binarybeachio: presigned PUT for uploads (R2/B2 don't implement PostObject) 2026-04-30 17:56:52 -10:00
file.service.ts binarybeachio: presigned PUT for uploads (R2/B2 don't implement PostObject) 2026-04-30 17:56:52 -10:00
instance.service.ts fix: remove unused imports and variables (part 2 — web/core non-issues) (#8752) 2026-03-25 02:04:20 +05:30
issue_filter.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
module.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
module_archive.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
sticky.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
timezone.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
user.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
view.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
webhook.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
workspace-notification.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
workspace.service.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30