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- ..
- ai.ts
- apps.ts
- audit.ts
- auth.ts
- central-core.d.mts
- central-core.mjs
- central.ts
- cloud.ts
- config.ts
- crypto.ts
- db.ts
- design.ts
- engines.ts
- files.ts
- gates.ts
- gateway.ts
- marketplace-core.d.mts
- marketplace-core.mjs
- metrics.ts
- modules.ts
- motion.ts
- nexus-core.d.mts
- nexus-core.mjs
- oidc-core.d.mts
- oidc-core.mjs
- oidc.ts
- providers.ts
- proxy-core.d.mts
- proxy-core.mjs
- pwauth-core.d.mts
- pwauth-core.mjs
- requirements.ts
- rls.sql.d.mts
- rls.sql.mjs
- services-content.ts
- ssrf.ts
- status.ts
- tenant.ts
- tlsgate.ts
- workspace.ts
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.