Explorar o código

Fix bug: wrong variable

sbkwgh %!s(int64=8) %!d(string=hai) anos
pai
achega
0e22ac47be
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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) {