Passwort Falsch Abfrage und Version auf Dashboard
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user