浏览代码

Fix bug: wrong variable

sbkwgh 8 年之前
父节点
当前提交
0e22ac47be
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      routes/user.js

+ 3 - 1
routes/user.js

@@ -52,10 +52,12 @@ router.post('/', async (req, res) => {
 				admin: true
 			}})
 
-			if(admin) {
+			if(adminUser) {
+
 				validationErrors.push(Errors.missingParameter('token'))
 				throw Errors.VALIDATION_ERROR
 			} else {
+				
 				userParams.admin = true
 			}
 		} else if(req.body.admin && req.body.token) {