debug: sample tokens in debug endpoint
This commit is contained in:
@@ -59,13 +59,14 @@ router.delete('/:id', authenticate, (req, res) => {
|
|||||||
res.json({ ok: true });
|
res.json({ ok: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Debug: Tabellenstatus prüfen
|
// Debug: Tabellenstatus + eigene Shares mit Token
|
||||||
router.get('/debug-table', (req, res) => {
|
router.get('/debug-table', (req, res) => {
|
||||||
try {
|
try {
|
||||||
const exists = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='public_file_shares'").get();
|
const exists = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='public_file_shares'").get();
|
||||||
const count = exists ? db.prepare('SELECT COUNT(*) as n FROM public_file_shares').get() : null;
|
const count = exists ? db.prepare('SELECT COUNT(*) as n FROM public_file_shares').get() : null;
|
||||||
const cols = exists ? db.pragma('table_info(public_file_shares)').map(c=>c.name) : [];
|
const cols = exists ? db.pragma('table_info(public_file_shares)').map(c=>c.name) : [];
|
||||||
res.json({ exists: !!exists, count: count?.n, cols });
|
const sample = exists ? db.prepare('SELECT id, token, user_id, file_id, folder_id, expires_at, download_count FROM public_file_shares LIMIT 5').all() : [];
|
||||||
|
res.json({ exists: !!exists, count: count?.n, cols, sample });
|
||||||
} catch(e) { res.status(500).json({ error: e.message }); }
|
} catch(e) { res.status(500).json({ error: e.message }); }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user