Skip to content

Commit b9cf911

Browse files
Nodenesterclaude
andcommitted
Add dashboard screenshots and dev bypass auth helper
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fe83d1b commit b9cf911

6 files changed

Lines changed: 22 additions & 15 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
AI agents in containers. Chat with them, watch them work, trigger them from GitHub.
44

55
<p align="center">
6-
<img src="docs/login-desktop.png" alt="AgentBox Login — Desktop" width="600" />
6+
<img src="docs/dashboard-desktop.png" alt="AgentBox Dashboard — Desktop" width="700" />
77
</p>
88

99
<p align="center">
10-
<img src="docs/login-mobile.png" alt="AgentBox Login — Mobile" width="200" />
10+
<img src="docs/dashboard-mobile.png" alt="AgentBox Dashboard — Mobile" width="220" />
11+
&nbsp;&nbsp;&nbsp;
12+
<img src="docs/login-mobile.png" alt="AgentBox Login — Mobile" width="220" />
1113
</p>
1214

1315
```

docs/dashboard-desktop.png

397 KB
Loading

docs/dashboard-mobile.png

196 KB
Loading

web/src/app/api/agents/route.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1-
import { auth } from "@/lib/auth";
1+
import { getUser } from "@/lib/dev-auth";
22
import { listAgents, createAgent } from "@/lib/docker";
33
import { NextRequest, NextResponse } from "next/server";
44

5-
// GET /api/agents — list all agents (shared across org)
65
export async function GET() {
7-
const session = await auth();
8-
if (!session?.user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
9-
10-
// List ALL agents — shared view, everyone in the org sees everything
6+
const user = await getUser();
7+
if (!user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
118
const agents = await listAgents("");
129
return NextResponse.json(agents);
1310
}
1411

15-
// POST /api/agents — create a new agent
1612
export async function POST(req: NextRequest) {
17-
const session = await auth();
18-
if (!session?.user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
19-
13+
const user = await getUser();
14+
if (!user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
2015
const { name } = await req.json();
2116
if (!name) return NextResponse.json({ error: "Name required" }, { status: 400 });
22-
23-
const username = (session.user as any).username || "user";
24-
const agent = await createAgent(username, name);
17+
const agent = await createAgent((user as any).username || "dev", name);
2518
return NextResponse.json(agent);
2619
}

web/src/app/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { auth, signIn } from "@/lib/auth";
22
import { redirect } from "next/navigation";
33

44
export default async function Home() {
5+
if (process.env.DEV_BYPASS === "true") redirect("/dashboard");
56
const session = await auth();
67
if (session) redirect("/dashboard");
78

web/src/lib/dev-auth.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { auth } from "@/lib/auth";
2+
3+
// Returns session user or dev bypass user
4+
export async function getUser() {
5+
if (process.env.DEV_BYPASS === "true") {
6+
return { id: "dev", username: "dev", name: "Dev User", email: "dev@agentbox.local" };
7+
}
8+
const session = await auth();
9+
if (!session?.user) return null;
10+
return { ...session.user, username: (session.user as any).username || "user" };
11+
}

0 commit comments

Comments
 (0)