Skip to content

[P1.7] Don't return upstream GitHub 401s as this API's 401 (forces web-UI logout) #734

Description

@frankbria

Severity: high | Category: correctness | Phase: P1.7

Problem

A bad/revoked GitHub PAT maps InvalidTokenError to HTTP 401, and pr_v2 propagates GitHub's status verbatim. The web UI's axios interceptor reacts to any 401 with clearToken(); redirect('/login') — so entering an invalid PAT, or a revoked token, logs the user out of CodeFRAME itself.

Evidence

codeframe/ui/routers/github_integrations_v2.py:205, codeframe/ui/routers/pr_v2.py:306

Acceptance criteria

  • Upstream-credential failures map to a distinct code (e.g. 400/502 UPSTREAM_AUTH_FAILED), never raw 401 on authenticated routes.
  • Optionally the web UI scopes its logout redirect to a specific auth-expiry code.

Dependencies

None


Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-high-betaHigh priority - should fix before beta for best experiencepriority:hightype:bugSomething is broken and needs fixing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions