Skip to content
  1. Home
  2. workspace
Checking…
Public view — sanitized data only. Sign in over HTTPS to create projects and manage the workspace.

AI Engineering Workspace

Partial

Chat, 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

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

Partial
Sign 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.