make project file tokens public; keep name links with image preview and file download
This commit is contained in:
@@ -505,7 +505,7 @@ function isImageName(name) {
|
||||
return /\.(jpe?g|png|gif|webp|bmp|avif|svg|ico)$/i.test(name || '');
|
||||
}
|
||||
|
||||
app.get('/api/files/:token', requireAdmin, async (req, res) => {
|
||||
app.get('/api/files/:token', async (req, res) => {
|
||||
const { rows } = await pool.query('SELECT path, name FROM project_files WHERE token = $1', [req.params.token]);
|
||||
if (!rows.length) return res.status(404).json({ error: 'Not found' });
|
||||
const r = rows[0];
|
||||
|
||||
Reference in New Issue
Block a user