AI Engineering Workspace
PartialChat, files, terminal and preview in one place. Chat sessions run on a durable Postgres-backed queue (chat only: no tools or shell). Live models need an API key; the terminal is unavailable.
Project files
read-only- ..
- _clean.mjs
- acceptance.mjs
- ai-adapters.mjs
- ai-enqueue.mjs
- central.mjs
- deploy-flow.mjs
- external-vps.mjs
- fake-opencode.mjs
- gates.mjs
- immersive.mjs
- lower.mjs
- nexus.mjs
- oidc-core.mjs
- oidc-flow.mjs
- opencode-engine.mjs
- owner-auth.mjs
- proxy.mjs
- retake-landing.mjs
- rls.mjs
- run.mjs
- services.mjs
- shot-central.mjs
- tenant-isolation.mjs
- trusted-https.mjs
- web-shots.mjs
- with-derived.mjs
app/src/app/auth/backchannel-logout/route.ts
1import { asSystem, db } from "@/lib/db";2import { audit } from "@/lib/audit";3import { oidcConfig, withKeys } from "@/lib/oidc";4import { verifyLogoutToken } from "@/lib/oidc-core.mjs";5export const dynamic = "force-dynamic";6// OIDC Back-Channel Logout: the IdP (server-to-server) revokes Studio sessions. Authenticated solely by the signed logout token.7export const POST = (req: Request) => asSystem(async () => {8 const cfg = await oidcConfig(); if (!cfg.configured) return Response.json({ error: "not configured" }, { status: 503 });9 const form = await req.formData().catch(() => null); const tok = String(form?.get("logout_token") ?? ""); if (!tok) return Response.json({ error: "logout_token required" }, { status: 400, headers: { "cache-control": "no-store" } });10 try {11 const t = await withKeys(cfg.issuer, k => verifyLogoutToken(tok, k, { issuer: cfg.issuer, clientId: cfg.clientId }));12 const r = await db().prepare("DELETE FROM sessions WHERE idp_iss=? AND ((?::text IS NOT NULL AND idp_sid=?) OR (?::text IS NOT NULL AND user_id IN (SELECT user_id FROM external_identities WHERE issuer=? AND subject=?)))").run(t.iss, t.sid, t.sid, t.sub, t.iss, t.sub);13 await audit("idp", "auth.oidc.backchannel_logout", "", { revoked: r.changes }); return new Response(null, { status: 200, headers: { "cache-control": "no-store" } });14 } catch { return Response.json({ error: "invalid logout token" }, { status: 400, headers: { "cache-control": "no-store" } }); }15});16
Conversation
PartialSign in to start AI sessions.
Task checklist
- Application shell deployed
- Persistent projects
- Agent runtime
- Sandboxed terminal
Execution activity
No agent sessions. Git HEAD 0eebc42 on master.
Approval requests
None pending.