v0.11.26 new rules for default admin user
This commit is contained in:
@@ -281,6 +281,7 @@ router.patch('/me/profile', authMiddleware, async (req, res) => {
|
||||
|
||||
// Upload avatar
|
||||
router.post('/me/avatar', authMiddleware, uploadAvatar.single('avatar'), async (req, res) => {
|
||||
if (req.user.is_default_admin) return res.status(403).json({ error: 'Default admin avatar cannot be changed' });
|
||||
if (!req.file) return res.status(400).json({ error: 'No file uploaded' });
|
||||
try {
|
||||
const sharp = require('sharp');
|
||||
|
||||
Reference in New Issue
Block a user