fix(api,web): add workspace context to widgets and auto-detect workspace ID #532

Merged
jason.woltje merged 1 commits from fix/workspace-context-widgets-and-credentials into main 2026-02-27 04:53:08 +00:00
Owner

Summary

  • Add WorkspaceGuard to all widget data endpoints in WidgetsController
  • Auto-detect workspace ID from localStorage in apiRequest when not explicitly provided
  • Replace hardcoded "default-workspace-id" in credentials pages with useWorkspaceId() hook

Test plan

  • Dashboard Active Projects widget loads without 401
  • Dashboard Agent Chains widget loads without 401
  • Credentials page loads without 500 error
  • File Manager page sends workspace ID header
  • All existing tests pass (3303 tests)

🤖 Generated with Claude Code

## Summary - Add WorkspaceGuard to all widget data endpoints in WidgetsController - Auto-detect workspace ID from localStorage in apiRequest when not explicitly provided - Replace hardcoded "default-workspace-id" in credentials pages with useWorkspaceId() hook ## Test plan - [ ] Dashboard Active Projects widget loads without 401 - [ ] Dashboard Agent Chains widget loads without 401 - [ ] Credentials page loads without 500 error - [ ] File Manager page sends workspace ID header - [ ] All existing tests pass (3303 tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jason.woltje added 1 commit 2026-02-27 04:49:21 +00:00
fix(api,web): add workspace context to widget endpoints and auto-detect workspace ID
All checks were successful
ci/woodpecker/push/api Pipeline was successful
ci/woodpecker/push/web Pipeline was successful
64d3ad810b
- Add WorkspaceGuard to all widget data endpoints in WidgetsController
- Use RequestWithWorkspace type for proper type safety (no non-null assertions)
- Auto-detect workspace ID from localStorage in apiRequest when not
  explicitly provided, fixing all API calls missing X-Workspace-Id header
- Replace hardcoded "default-workspace-id" in credentials pages with
  useWorkspaceId() hook

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jason.woltje merged commit edcff6a0e0 into main 2026-02-27 04:53:08 +00:00
jason.woltje deleted branch fix/workspace-context-widgets-and-credentials 2026-02-27 04:53:08 +00:00
Sign in to join this conversation.