fix(web): scope the ?view=mcp guest exemption to / (#1553)

This commit is contained in:
Rajarshi Datta 2026-08-19 18:33:58 +05:30 committed by GitHub
parent 18a2dfbe39
commit 7d59070ad6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,13 +41,14 @@ export default async function proxy(request: Request) {
return NextResponse.next()
}
// MCP setup page is public — no auth required
if (url.searchParams.get("view") === "mcp") {
return NextResponse.next()
}
// Integrations index is public in guest mode; actions still require login.
if (url.pathname === "/" && url.searchParams.get("view") === "integrations") {
// Integrations index and MCP setup are public in guest mode; actions still
// require login. The ?view param is only meaningful at "/" (see
// lib/view-mode-context, which ignores it elsewhere), so scope it there —
// unscoped, ?view=mcp would let any path skip the /api/ gate below.
if (
url.pathname === "/" &&
["integrations", "mcp"].includes(url.searchParams.get("view") ?? "")
) {
return NextResponse.next()
}