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- ..
- apple-touch-icon.png
- brand-guidelines-v2.md
- brand-manifest-v2.json
- favicon-16.png
- favicon-32.png
- favicon-48.png
- favicon.ico
- icon-192.png
- icon-512.png
- maskable-192.png
- maskable-512.png
- source-brand-board.png
- source-crop-icon-fullcolor.png
- source-crop-lockup-dark.png
- source-crop-wordmark-light.png
- zloud-app-icon-1024.png
- zloud-app-icon.svg
- zloud-favicon.svg
- zloud-mark-1024.png
- zloud-mark-512.png
- zloud-mark-mono-512.png
- zloud-mark-mono.svg
- zloud-mark-reversed.svg
- zloud-mark-white-512.png
- zloud-mark-white.svg
- zloud-mark.svg
- zloud-maskable.svg
- zloud-wordmark-dark.svg
- zloud-wordmark-light.svg
- zloud-wordmark-mono.svg
app/src/app/auth/login/route.ts
1import { cookies } from "next/headers";2import { asSystem, db, now } from "@/lib/db";3import { isSecure, httpsBase } from "@/lib/auth";4import { authorizationUrl, newPkce, rand } from "@/lib/oidc-core.mjs";5import { discovery, oidcConfig } from "@/lib/oidc";6export const dynamic = "force-dynamic";7// Starts Authorization Code + PKCE. Sensitive: HTTPS only. Nothing is contacted until a client secret has been provisioned.8export async function GET() {9 if (!(await isSecure())) return Response.json({ error: "sign-in requires HTTPS" }, { status: 403 });10 const cfg = await oidcConfig();11 if (!cfg.configured) return Response.json({ error: "Zoo IAM sign-in is not configured on this deployment (client credentials not provisioned)." }, { status: 503 });12 try {13 const disc = await discovery(cfg.issuer); const state = rand(24), nonce = rand(24), pk = newPkce();14 await asSystem(async () => { await db().prepare("DELETE FROM oidc_requests WHERE created_at < ?").run(Date.now() - 600_000); await db().prepare("INSERT INTO oidc_requests(state,nonce,verifier,created_at) VALUES(?,?,?,?)").run(state, nonce, pk.verifier, Date.now()); });15 (await cookies()).set("zcs_oidc", state, { httpOnly: true, secure: true, sameSite: "lax", path: "/auth", maxAge: 600 }); // binds the flow to THIS browser (login-CSRF defence)16 return Response.redirect(authorizationUrl(disc, { redirectUri: cfg.redirectUri || `${await httpsBase()}/auth/callback`, state, nonce, challenge: pk.challenge, acr: cfg.requireAcr }), 302);17 } catch { return Response.json({ error: "Zoo IAM is unreachable or misconfigured" }, { status: 502 }); }18}19
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 692573d on master.
Approval requests
None pending.