@tiledesk/tiledesk-server 2.3.72 → 2.3.74
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +24 -0
- package/event/botEvent.js +13 -1
- package/middleware/passport.js +39 -11
- package/models/faq_kb.js +5 -0
- package/models/presence.js +1 -1
- package/models/project.js +3 -0
- package/models/user.js +1 -0
- package/package.json +2 -2
- package/pubmodules/activities/models/activity.js +2 -0
- package/pubmodules/cache/mongoose-cachegoose-fn.js +171 -43
- package/pubmodules/emailNotification/requestNotification.js +15 -5
- package/pubmodules/pubModulesManager.js +6 -6
- package/routes/auth.js +24 -8
- package/routes/faq.js +6 -1
- package/routes/faq_kb.js +50 -1
- package/routes/message.js +7 -4
- package/routes/project.js +49 -1
- package/routes/widget.js +95 -13
- package/services/BotSubscriptionNotifier.js +17 -1
- package/services/cacheEnabler.js +5 -0
- package/services/departmentService.js +1 -1
- package/services/faqBotHandler.js +1 -1
- package/services/faqBotSupport.js +1 -1
- package/services/operatingHoursService.js +1 -1
- package/services/subscriptionNotifier.js +8 -2
- package/template/email/emailDirect.html +2 -0
- package/template/email/newMessage.html +1 -1
- package/test/messageRoute.js +1 -1
- package/utils/sendMessageUtil.js +2 -2
- package/websocket/webSocketServer.js +4 -4
@@ -22,7 +22,7 @@ var cacheUtil = require('../utils/cacheUtil');
|
|
22
22
|
var mongoose = require('mongoose');
|
23
23
|
const requestConstants = require("../models/requestConstants");
|
24
24
|
var RoleConstants = require('../models/roleConstants');
|
25
|
-
let
|
25
|
+
let configSecretOrPubicKay = process.env.GLOBAL_SECRET_OR_PUB_KEY || process.env.GLOBAL_SECRET || config.secret;
|
26
26
|
var cacheEnabler = require("../services/cacheEnabler");
|
27
27
|
|
28
28
|
|
@@ -71,14 +71,14 @@ class WebSocketServer {
|
|
71
71
|
|
72
72
|
var token = queryParameter.token;
|
73
73
|
winston.debug('token:'+ token);
|
74
|
-
winston.debug('
|
74
|
+
winston.debug('configSecretOrPubicKay:'+ configSecretOrPubicKay);
|
75
75
|
|
76
76
|
|
77
77
|
if (!token)
|
78
78
|
cb(false, 401, 'Unauthorized');
|
79
79
|
else {
|
80
80
|
token = token.replace('JWT ', '');
|
81
|
-
jwt.verify(token,
|
81
|
+
jwt.verify(token, configSecretOrPubicKay, function (err, decoded) { //pub_jwt pp_jwt
|
82
82
|
if (err) {
|
83
83
|
winston.error('WebSocket error verifing websocket jwt token ', err);
|
84
84
|
return cb(false, 401, 'Unauthorized');
|
@@ -189,7 +189,7 @@ class WebSocketServer {
|
|
189
189
|
|
190
190
|
if (cacheEnabler.project) {
|
191
191
|
q.cache(cacheUtil.defaultTTL, "projects:id:"+projectId) //project_cache
|
192
|
-
winston.debug('project cache enabled');
|
192
|
+
winston.debug('project cache enabled for websocket');
|
193
193
|
}
|
194
194
|
|
195
195
|
return q.exec(function(err, project) {
|