@tiledesk/tiledesk-server 2.7.6 → 2.7.7
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +5 -0
- package/package.json +2 -2
- package/pubmodules/whatsapp/listener.js +4 -0
- package/routes/auth.js +3 -1
package/CHANGELOG.md
CHANGED
@@ -5,6 +5,11 @@
|
|
5
5
|
🚀 IN PRODUCTION 🚀
|
6
6
|
(https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
|
7
7
|
|
8
|
+
# 2.7.7
|
9
|
+
- Fix update user verifiedEmail with signup from Admin
|
10
|
+
- Updated WhatsApp listener to reduce mongodb connections
|
11
|
+
- Fix duplicated intents
|
12
|
+
|
8
13
|
# 2.7.6
|
9
14
|
- Fix auth with admin token
|
10
15
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tiledesk/tiledesk-server",
|
3
3
|
"description": "The Tiledesk server module",
|
4
|
-
"version": "2.7.
|
4
|
+
"version": "2.7.7",
|
5
5
|
"scripts": {
|
6
6
|
"start": "node ./bin/www",
|
7
7
|
"pretest": "mongodb-runner start",
|
@@ -49,7 +49,7 @@
|
|
49
49
|
"@tiledesk/tiledesk-telegram-connector": "^0.1.10",
|
50
50
|
"@tiledesk/tiledesk-train-jobworker": "^0.0.7",
|
51
51
|
"@tiledesk/tiledesk-tybot-connector": "^0.2.60",
|
52
|
-
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.
|
52
|
+
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.65",
|
53
53
|
"@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.7",
|
54
54
|
"amqplib": "^0.5.5",
|
55
55
|
"app-root-path": "^3.0.0",
|
@@ -1,10 +1,13 @@
|
|
1
1
|
const whatsapp = require("@tiledesk/tiledesk-whatsapp-connector");
|
2
2
|
var winston = require('../../config/winston');
|
3
3
|
var configGlobal = require('../../config/global');
|
4
|
+
const mongoose = require("mongoose");
|
4
5
|
|
5
6
|
const apiUrl = process.env.API_URL || configGlobal.apiUrl;
|
6
7
|
winston.info('Whatsapp apiUrl: ' + apiUrl);
|
7
8
|
|
9
|
+
const dbConnection = mongoose.connection;
|
10
|
+
|
8
11
|
class Listener {
|
9
12
|
|
10
13
|
listen(config) {
|
@@ -38,6 +41,7 @@ class Listener {
|
|
38
41
|
|
39
42
|
whatsapp.startApp({
|
40
43
|
MONGODB_URL: config.databaseUri,
|
44
|
+
dbconnection: dbConnection,
|
41
45
|
API_URL: apiUrl,
|
42
46
|
BASE_FILE_URL: baseFileUrl,
|
43
47
|
GRAPH_URL: graph_url,
|
package/routes/auth.js
CHANGED
@@ -77,7 +77,7 @@ router.post('/signup',
|
|
77
77
|
return res.json({ success: false, msg: 'Please pass email and password.' });
|
78
78
|
} else {
|
79
79
|
return userService.signup(req.body.email, req.body.password, req.body.firstname, req.body.lastname, false)
|
80
|
-
.then(function (savedUser) {
|
80
|
+
.then( async function (savedUser) {
|
81
81
|
|
82
82
|
winston.debug('-- >> -- >> savedUser ', savedUser.toObject());
|
83
83
|
|
@@ -87,6 +87,8 @@ router.post('/signup',
|
|
87
87
|
let token = req.headers.authorization.split(" ")[1];
|
88
88
|
let decode = jwt.verify(token, pubConfigSecret)
|
89
89
|
if (decode && (decode.email === process.env.ADMIN_EMAIL)) {
|
90
|
+
let updatedUser = await User.findByIdAndUpdate(savedUser._id, { emailverified: true }, { new: true }).exec();
|
91
|
+
winston.debug("updatedUser: ", updatedUser);
|
90
92
|
skipVerificationEmail = true;
|
91
93
|
winston.verbose("skip sending verification email")
|
92
94
|
}
|