Skip to content

Commit 245c6ad

Browse files
committed
fix: restrict dev disconnect endpoint to DEVELOPMENT environments
1 parent 09ac03a commit 245c6ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/webapp/app/routes/engine.v1.dev.disconnect.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ const { action } = createActionApiRoute(
3535
method: "POST",
3636
},
3737
async ({ authentication, body }) => {
38+
// Only allow dev environments — this endpoint uses finalizeRun which
39+
// skips PENDING_CANCEL and immediately finalizes executing runs.
40+
if (authentication.environment.type !== "DEVELOPMENT") {
41+
return json({ error: "This endpoint is only available for dev environments" }, { status: 403 });
42+
}
43+
3844
const environmentId = authentication.environment.id;
3945

4046
// Rate limit per environment

0 commit comments

Comments
 (0)