Commit Graph

2 Commits

Author SHA1 Message Date
Rokojori 7c754e4256 feat: auth session refresh overhaul — all 7 phases
Fixes two root-cause bugs: browser tabs racing the same single-use refresh
token, and Electron never refreshing after its one-shot startup call.

Browser:
- TokenUpdater: periodic 5-min + activity-triggered pings to /api/auth/me,
  EventSlot-driven valid/refreshing/expired/network-error state.
  Web Locks leader election (one tab runs the updater; others follow via
  BroadcastChannel). Falls back to leader-always without Locks API support.
- GuardedCall: three-tier wrapper (user/editor/silent) with pre-flight state
  check and tier-specific retry. Replaces ad-hoc fetch calls in Editor and
  editor-shell layout save/load.
- auth-connector: jwtMiddleware proactively rotates access-token cookie
  within 15 min of real expiry (server clock, no client-side exp needed).

Electron:
- Periodic token updater in main process: reads JWT exp directly, uses
  server-corrected clock (Date response header offset) for comparisons,
  refreshes within 15 min of expiry. Replaces one-shot startup refresh.
- Session heartbeat: running instance writes accessToken + timestamp every
  10 s. New instance mints its own session via POST /api/auth/new-session
  if heartbeat is ≤30 s old — skips login screen transparently.
- Retired plaintext last-password.txt auto-login.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-02 22:39:56 +02:00
Rokojori 6766f6d467 history: Saturday, 2 August 2026 — Claude API + Claude Code providers for rojo-chat-panel
- Claude API provider (@anthropic-ai/sdk): streaming, separate session history,
  tool use support, rojo-settings-panel claude endpoint type
- Claude Code subprocess provider: --print --output-format stream-json --verbose,
  --session-id/--resume multi-turn, shell:false Windows fix,
  rojo-settings-panel claude-code endpoint type (no API key)
- Rojo local-mode fixes: detection, creation, system-prompt delivery
- Three subprocess bugs fixed: missing --verbose, stdin blocking, cmd.exe mangling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-02 12:32:11 +02:00