Passwort Falsch Abfrage und Version auf Dashboard

This commit is contained in:
2026-05-28 10:53:32 +02:00
parent 155d6424bb
commit d547725289
4 changed files with 76 additions and 6 deletions

View File

@@ -212,7 +212,10 @@ router.get('/:id/download', authenticate, async (req, res) => {
const bcrypt = require('bcryptjs');
const pw = req.query.password || req.headers['x-share-password'] || '';
const ok = pw && await bcrypt.compare(pw, share.password_hash);
if (!ok) return res.status(403).json({ error: 'Falsches Passwort', passwordRequired: true });
if (!ok) return res.status(403).json({
error: 'Falsches Passwort',
passwordRequired: !pw // true = noch kein PW eingegeben, false = falsches PW
});
}
const fp = path.join(UPLOAD_DIR, file.filename);