admin could add user, fix #14

This commit is contained in:
lesion
2019-06-18 14:45:04 +02:00
parent f77e6b1ed6
commit 85694906f1
9 changed files with 83 additions and 46 deletions

View File

@@ -39,13 +39,6 @@ const Auth = {
if (req.user.is_admin && req.user.is_active) return next()
return res.status(403).send({ message: 'Admin needed' })
},
async adminOrFirstRun(req, res, next) {
if (req.user && req.user.is_admin && req.user.is_active) return next()
const settings = await Settings.settings()
if (!settings.firstRun) {
return next()
}
}
}