[bug] Fix connection without jwt

This commit is contained in:
Sergey Konovalov
2022-10-27 16:17:10 +03:00
parent 6fedd46126
commit a6615dea84

View File

@ -1327,7 +1327,7 @@ exports.install = function(server, callbackFunction) {
ctx.logger.info('io.use error: %s', err.stack);
} finally {
ctx.logger.info('io.use end');
next(checkJwtRes.decoded ? undefined : new Error("not authorized"));
next((checkJwtRes && !checkJwtRes.decoded) ? new Error("not authorized") : undefined);
}
});
});