bugfix: prevent an account level api key from creating an admin-level api key

This commit is contained in:
Dave Horton
2021-06-28 13:00:35 -04:00
parent 0589328f24
commit 7b9390be50
+1 -4
View File
@@ -71,10 +71,7 @@ async function validateDeleteToken(req, sid) {
router.post('/', async(req, res) => {
const logger = req.app.locals.logger;
try {
if ('add' in preconditions) {
assert(typeof preconditions.add === 'function');
await preconditions.add(req);
}
await validateAddToken(req);
const uuid = await ApiKey.make(req.body);
res.status(201).json({sid: uuid, token: req.body.token});
} catch (err) {