Browse Source

Mini fix on authorization

Nik Atlas 6 years ago
parent
commit
412be3affe
1 changed files with 2 additions and 2 deletions
  1. 2 2
      middlewares/authorization.js

+ 2 - 2
middlewares/authorization.js

@@ -7,14 +7,14 @@ class Authorization {
 	_parseToken(req, res, next) {
 	_parseToken(req, res, next) {
 		const token = req.query.token;
 		const token = req.query.token;
 		if(!token)return next();
 		if(!token)return next();
-		console.log("Token parsing : " + token);
+		// console.log("Token parsing : " + token);
 		UserRepository.getUser(token).
 		UserRepository.getUser(token).
 		then((user) => {
 		then((user) => {
 			req.user = user;
 			req.user = user;
 			next();
 			next();
 		}).
 		}).
 		catch((err) => {
 		catch((err) => {
-			next(err);
+			res.sendStatus(400);
 		});
 		});
 	}
 	}
 	getTokenParser() {
 	getTokenParser() {