mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
Block uploads for demo user, restore PDF preview modal (v2.2.3)
- Demo user gets 403 on all upload endpoints (files, photos, cover, avatar) - Admin uploads still work normally - PDF export back in modal popup using srcdoc iframe - Zero behavior change when DEMO_MODE is not set
This commit is contained in:
@@ -53,4 +53,11 @@ const adminOnly = (req, res, next) => {
|
||||
next();
|
||||
};
|
||||
|
||||
module.exports = { authenticate, optionalAuth, adminOnly };
|
||||
const demoUploadBlock = (req, res, next) => {
|
||||
if (process.env.DEMO_MODE === 'true' && req.user?.email === 'demo@nomad.app') {
|
||||
return res.status(403).json({ error: 'Uploads are disabled in demo mode. Self-host NOMAD for full functionality.' });
|
||||
}
|
||||
next();
|
||||
};
|
||||
|
||||
module.exports = { authenticate, optionalAuth, adminOnly, demoUploadBlock };
|
||||
|
||||
Reference in New Issue
Block a user