Go to file
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
electron feat: auth session refresh overhaul — all 7 phases 2026-08-02 22:39:56 +02:00
scripts electron: desktop app shell — login, JWT auth, header injection, token persistence 2026-07-14 13:31:11 +02:00
source feat: auth session refresh overhaul — all 7 phases 2026-08-02 22:39:56 +02:00
workspace feat: auth session refresh overhaul — all 7 phases 2026-08-02 22:39:56 +02:00
.gitignore Updated Git Ignore 2026-07-13 20:12:33 +02:00
.gitmodules Connector Rewrite 2026-07-17 13:37:48 +02:00
CLAUDE.md history: tab container updates, EditorPanel interfaces, editor-shell bug fixes, workspace docs 2026-07-25 22:50:14 +02:00
package-lock.json history: Saturday, 2 August 2026 — Claude API + Claude Code providers for rojo-chat-panel 2026-08-02 12:32:11 +02:00
package.json history: Saturday, 2 August 2026 — Claude API + Claude Code providers for rojo-chat-panel 2026-08-02 12:32:11 +02:00
tsconfig.client.json Fixed Build Errors 2026-07-17 13:47:43 +02:00
tsconfig.electron-server.json electron: desktop app shell — login, JWT auth, header injection, token persistence 2026-07-14 13:31:11 +02:00
tsconfig.electron.json electron: desktop app shell — login, JWT auth, header injection, token persistence 2026-07-14 13:31:11 +02:00
tsconfig.json Changed Alias Paths 2026-07-17 14:00:16 +02:00
tsconfig.ts-node.json Fixed Build Errors 2026-07-17 13:47:43 +02:00