Make file auths one use
This commit is contained in:
parent
7808c815fe
commit
c7d23be557
|
@ -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`);
|
||||
});
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue