Conversation
When built with the AUTH env var set to an OSC login URL, redirect the browser there whenever the manager returns HTTP 401 so the user can re-authenticate. Wired into the central handleFetchRequest choke point so all endpoints behave uniformly; no-op when AUTH is unset. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Code ReviewVerdict: LGTM Summary: Clean, well-scoped implementation. The redirect fires on exactly 401 only when Blocking
Warnings
Suggestions
|
Automated code review (daily-backlog-pr) — LGTMVerdict recorded as a comment: the pipeline account authored this PR, so it cannot post a formal Approve or self-merge. A human maintainer needs to approve + merge. Clean, well-contained change. The redirect is a genuine no-op when |
|
code-reviewer verdict: NEEDS CHANGES (PR #695, closes #166) Implementation is clean and correctly fixes #166 with good tests; no open-redirect (target is a build-time constant). One blocking item:
Note: recorded as a comment, not a state-bearing |
|
Automated code-review verdict: NEEDS CHANGES — implements #166. Posted as a comment, not a state-bearing GitHub review: the daily-backlog-pr review identity ( |
|
code-reviewer verdict: Needs Changes (self-authored PR — marker in lieu of a state-bearing review, which GitHub blocks for the automation's own account). Three Warnings, no single Blocking, but 3+ Warnings with no mitigations → Needs Changes:
Board item moved back to Ready for the implementer to address. |
Summary
AUTH(an OSC login URL). When set, any HTTP 401 from the manager navigates the browser to that URL so the user can (re)authenticate — implements the OSC-hosted deployment flow described in Redirect to OSC login on 401 auth from intercom-manager #166.handleFetchRequest, so everyAPI.*endpoint behaves uniformly; a smallmaybeRedirectToAuth(status)helper does the redirect (with a loop guard) and is a pure no-op whenAUTHis unset, leaving the existing OSC reauth flow and all current behavior unchanged.AUTHvar (noVITE_prefix, as the issue specifies) viaenvPrefix: ["VITE_", "AUTH"]invite.config.ts, types it invite-env.d.ts, and passes it into the container build inscripts/entrypoint.sh.README.mdand.env.local.sample.Test plan
npm test) — added 4 focused tests for the redirect helper; existing 401 regression suite unchanged (151 tests / 19 files green locally)npm run typecheck)npm run lint)AUTHset at build time, a 401 from the manager redirects the browser to the configured URLAUTHunset, behavior is unchanged (existing reauth flow still runs)Closes #166
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com