|
@@ -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() {
|