Skip to content

fix: unify fetch calls to use authedFetch for protected routes#342

Merged
itsmiso-ai merged 1 commit into
mainfrom
fix/prune-auth-mode-fetch-calls
Jun 10, 2026
Merged

fix: unify fetch calls to use authedFetch for protected routes#342
itsmiso-ai merged 1 commit into
mainfrom
fix/prune-auth-mode-fetch-calls

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

Fixes #319

Replace plain fetch() with authedFetch() in all client-side API calls to protected mutating and data routes. This ensures DISPATCH_AUTH_MODE=basic operators get consistent Basic Auth header injection.

Files changed:

  • src/app/automation/activity/page.tsx: events list fetch
  • src/app/automation/workflows/[id]/page.tsx: workflow detail, dispatch, rerun
  • src/app/agents/agent-work-panel.tsx: agent work panel CRUD operations

Left unchanged: login page session check (pre-auth, not a protected route)

Replace plain fetch() with authedFetch() in all client-side API calls
to protected mutating and data routes. This ensures DISPATCH_AUTH_MODE=basic
operators get consistent Basic Auth header injection.

Files changed:
- src/app/automation/activity/page.tsx: events list fetch
- src/app/automation/workflows/[id]/page.tsx: workflow detail, dispatch, rerun
- src/app/agents/agent-work-panel.tsx: agent work panel CRUD operations

Left unchanged: login page session check (pre-auth, not a protected route)

Fixes #319

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Automated Review

Full PR review.

Analysis engine: review@https://litellm.jory.dev/v1 (openai)

Recommendation

Approved. This PR correctly addresses the technical debt identified in issue PR 319 by replacing plain fetch() calls with authedFetch() in client-side components that interact with protected API routes. This ensures consistent authentication (specifically Basic Auth) for operators when DISPATCH_AUTH_MODE=basic is configured.

Change-by-Change Findings

  • src/app/agents/agent-work-panel.tsx: Replaced fetch with authedFetch for retrieving agent work and for mutating actions (release, reassign).
  • src/app/automation/activity/page.tsx: Replaced fetch with authedFetch for retrieving the activity feed.
  • src/app/automation/workflows/[id]/page.tsx: Replaced fetch with authedFetch for fetching workflow details and for dispatching/rerunning workflow runs.

Standards Compliance

  • Code Standards: The changes follow the repository's pattern of using authedFetch for protected routes as documented in README.md and AGENTS.md.
  • Security: By using authedFetch, the implementation ensures that mutating requests (POST) and sensitive data reads are properly authenticated, preventing 401 errors for operators using Basic Auth.

Linked Issue Fit

  • Issue PR 319: The PR directly implements the recommendation from the audit finding: "Other active UI paths still use plain fetch() for protected mutating routes, which means DISPATCH_AUTH_MODE=basic operators can hit 401s". The implementation covers the specific files identified in the audit evidence.

@itsmiso-ai itsmiso-ai merged commit d919e9e into main Jun 10, 2026
3 checks passed
@itsmiso-ai itsmiso-ai deleted the fix/prune-auth-mode-fetch-calls branch June 10, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prune duplicated auth-mode wording/tests

1 participant