Make file auths one use

This commit is contained in:
Christopher Cookman 2025-09-15 11:17:08 -06:00
parent 7808c815fe
commit c7d23be557

View file

@ -25,7 +25,13 @@ router.get("/:fileId/:authToken", async (req, res) => {
if (err) {
log.error(`Error sending file: ${err}`);
res.status(500).send("Error sending file");
return;
}
// File sent successfully, delete auth
pool.query('DELETE FROM fileAuth WHERE token = ?', [authToken]).catch(err => {
log.error(`Error deleting file auth: ${err}`);
});
log.info(`File ${product.file} sent successfully`);
});
})