Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/Tiledesk/tiledesk-server
Browse files Browse the repository at this point in the history
  • Loading branch information
andrealeo83 committed Mar 29, 2024
2 parents 7f74fdd + 11208b6 commit 67298c1
Show file tree
Hide file tree
Showing 8 changed files with 399 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
🚀 IN PRODUCTION 🚀
(https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)

# 2.7.3
- Updated project profile call
- Updated tybot-connector to 0.2.59

# 2.7.2
- Improved QuoteManager with kbs and chatbots (disabled)
- Improved QuoteManager with AI multipliers
Expand Down
16 changes: 15 additions & 1 deletion middleware/has-role.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,22 @@ class RoleChecker {
}
} else {

/**
* Updated by Johnny - 29mar2024 - START
*/
// console.log("req.user: ", req.user);
if (req.user.email === process.env.ADMIN_EMAIL) {
req.user.attributes = { isSuperadmin: true };
next();
} else {
res.status(403).send({success: false, msg: 'you dont belong to the project.'});
}
/**
* Updated by Johnny - 29mar2024 - END
*/

// if (req.user) equals super admin next()
res.status(403).send({success: false, msg: 'you dont belong to the project.'});
//res.status(403).send({success: false, msg: 'you dont belong to the project.'});
}

});
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tiledesk/tiledesk-server",
"description": "The Tiledesk server module",
"version": "2.7.2",
"version": "2.7.3",
"scripts": {
"start": "node ./bin/www",
"pretest": "mongodb-runner start",
Expand Down Expand Up @@ -48,7 +48,7 @@
"@tiledesk/tiledesk-rasa-connector": "^1.0.10",
"@tiledesk/tiledesk-telegram-connector": "^0.1.10",
"@tiledesk/tiledesk-train-jobworker": "^0.0.7",
"@tiledesk/tiledesk-tybot-connector": "^0.2.57",
"@tiledesk/tiledesk-tybot-connector": "^0.2.59",
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.64",
"@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.7",
"amqplib": "^0.5.5",
Expand Down
23 changes: 19 additions & 4 deletions routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,29 @@ router.post('/signup',
} else {
return userService.signup(req.body.email, req.body.password, req.body.firstname, req.body.lastname, false)
.then(function (savedUser) {



winston.debug('-- >> -- >> savedUser ', savedUser.toObject());

// let skipVerificationEmail = false;
// if (req.headers.authorization) {

// let token = req.headers.authorization.split(" ")[1];
// let decode = jwt.verify(token, configSecret)
// if (decode && (decode.email === process.env.ADMIN_EMAIL)) {
// skipVerificationEmail = true;
// winston.verbose("skip sending verification email")
// }
// }

// if (!req.body.disableEmail){
// if (!skipVerificationEmail) {
// emailService.sendVerifyEmailAddress(savedUser.email, savedUser);
// }
// }

if (!req.body.disableEmail){
emailService.sendVerifyEmailAddress(savedUser.email, savedUser);
emailService.sendVerifyEmailAddress(savedUser.email, savedUser);
}



/*
Expand Down
Loading

0 comments on commit 67298c1

Please sign in to comment.