mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 05:57:32 +01:00
One account for every door, steps D3 and D4 of ADR-0009. D3 — Connected apps (Settings → Integrations): every app that signed in with the person's OrangeCat account (Solon, Loki, Heidi, any self-registered AI app), with what it may do, when it connected, when it was last used and how many live sessions it holds — and a Disconnect button that forgets the consent and revokes the app's refresh tokens. Until now a self-registered app could keep a thirty-day session the person had no screen to find. - src/services/auth/connectedApps.ts: list / revoke / revoke-all. Every query on the service-role-only oauth_* tables names the user; the unit tests pin that. - GET /api/connected-apps, DELETE /api/connected-apps/[clientId]: session auth only, so an app can never enumerate or revoke the others. D4 — Sign out everywhere now revokes the OAuth refresh tokens connected apps hold before it revokes OrangeCat's own sessions; before, it signed the person out of OrangeCat and left them signed in to everything that signs in through it. Account deletion revokes and forgets them too (the oauth_* rows do not cascade from auth.users). The OIDC key-rotation runbook writes down the order of operations that keeps the JWKS overlap so a rotation signs nobody out. Docs: ADR-0009 (the identity design of record: one account held by OrangeCat, every product and outside site a client of it, passwords optional, recovery with more than one path, what a person allowed they can see and take back — with the build order D1–D9 and every edge case's landing place). Verified: pnpm run verify green (3970 tests). Production E2E: emailed-code sign-in on orangecat.ch from Solon's sign-in page completes the round trip in five seconds with no consent screen for the trusted client; the Connected apps list itself needs the service-role key, so it is checked on production after deploy. Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3 Co-authored-by: Claude <noreply@anthropic.com>