Skip to content

Commit

Permalink
fix: projectId safeguard for event ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt committed Mar 4, 2024
1 parent af29f52 commit a877555
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/backend/src/api/v1/redirections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ redirections.post("/api/report", async (ctx: Context) => {
}

const validatedProjectId = parsedProjectId.data
const [{ project }] =
console.log(validatedProjectId)
const [project] =
await sql`select * from project where id = ${validatedProjectId} limit 1`
console.log(project)

if (!project) {
ctx.status = 401
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/api/v1/runs/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ router.post("/", async (ctx: Context) => {
}

const projectId = result.data
const [{ project }] =
const [project] =
await sql`select * from project where id = ${projectId} limit 1`

if (!project) {
Expand Down

0 comments on commit a877555

Please sign in to comment.