Files
DeepTutor/web
Bingxi Zhao (Frank) 8bae3caedb fix(multi-user): resolve rebase regressions and decouple auth from middleware
After rebasing onto current dev (v1.3.10), several issues surfaced that the
original PR did not account for:

Frontend (rebase regressions from older PR base):
- web/lib/knowledge-api.ts: restore 6 KnowledgeBaseSummary fields
  (id, source, assigned, read_only, provenance_label, available) that the
  multi-user knowledge feature added between the PR base and current dev.
- web/app/(workspace)/agents/page.tsx: restore the array-vs-{bots}
  response shape fallback; the tutorbot list endpoint returns either form.
- web/components/sidebar/BookRecent.tsx: wrap path with apiUrl() — the
  apiFetch swap accidentally dropped the wrapper.
- web/components/space/MemorySection.tsx: restore try/catch error toasts
  in loadMemory and clearMemory (still present in saveMemory and
  refreshMemory; were dropped in load/clear).

Backend (decouple auth from middleware):
- Remove user_context_middleware from api/main.py. It was redundant with
  require_auth (sets the user ContextVar for every protected route) and
  ws_require_auth (sets it for every WebSocket). When AUTH_ENABLED=true and
  a request had no valid token, the middleware fell back to
  local_admin_user() — harmless because require_auth then raised 401, but
  a latent footgun if any code reads the ContextVar before the dependency
  resolves. Removing it makes the auth flow single-pathed and removes the
  "ctx set twice" pattern.
- auth.py: add explicit type annotations to ws_require_auth (returns
  Token | _WsAuthFailed) and the ws_auth_failed sentinel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:43:58 +08:00
..
2026-05-12 02:20:30 +08:00
2026-01-23 01:42:25 +08:00
2026-05-01 01:39:08 +08:00
2026-05-12 02:20:30 +08:00
2026-05-12 02:20:30 +08:00
2025-12-28 23:45:41 +08:00
2025-12-28 23:45:41 +08:00
2026-01-23 01:42:25 +08:00
2026-05-08 02:36:24 +08:00
2026-05-12 02:20:30 +08:00
2025-12-28 23:45:41 +08:00
2026-01-15 02:49:17 +08:00