fix: resolve critical vulnerability V-002
Automatically generated security fix
This commit is contained in:
parent
911587ea68
commit
d73768645b
2 changed files with 4 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import { unlink } from "node:fs/promises";
|
|||
import { Elysia, t } from "elysia";
|
||||
import { uploadsDir } from "..";
|
||||
import db from "../db/db";
|
||||
import { Jobs } from "../db/types";
|
||||
import { WEBROOT } from "../helpers/env";
|
||||
import { userService } from "./user";
|
||||
|
||||
|
|
@ -12,8 +13,9 @@ export const deleteFile = new Elysia().use(userService).post(
|
|||
return redirect(`${WEBROOT}/`, 302);
|
||||
}
|
||||
|
||||
const existingJob = await db
|
||||
const existingJob = db
|
||||
.query("SELECT * FROM jobs WHERE id = ? AND user_id = ?")
|
||||
.as(Jobs)
|
||||
.get(jobId.value, user.id);
|
||||
|
||||
if (!existingJob) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export const deleteJob = new Elysia().use(userService).get(
|
|||
});
|
||||
|
||||
// delete the job
|
||||
db.query("DELETE FROM jobs WHERE id = ?").run(job.id);
|
||||
db.query("DELETE FROM jobs WHERE id = ? AND user_id = ?").run(job.id, user.id);
|
||||
return redirect(`${WEBROOT}/history`, 302);
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue