fixed problem with then catch chain (Promise)...
This commit is contained in:
@@ -10,12 +10,10 @@ var authenticate = (req, res, next) => {
|
||||
const useragent = req.get('User-Agent');
|
||||
const access = 'auth ' + useragent;
|
||||
|
||||
tools.mylog("TOKEN = ", token);
|
||||
tools.mylog("USER-AGENT = ", useragent);
|
||||
|
||||
User.findByToken(token, access).then((user) => {
|
||||
if (!user) {
|
||||
tools.mylog("TOKEN NOT FOUND! Maybe Connected to other Page");
|
||||
tools.mylog("TOKEN " + token + " NOT FOUND! (Maybe Connected to other Page) ACCESS: '" + access + "'");
|
||||
return Promise.reject(server_constants.RIS_CODE_HTTP_INVALID_TOKEN);
|
||||
// res.status().send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user